Skip to content

Commit

Permalink
XWiki export doesn't work properly when a diagram is present. xwikis…
Browse files Browse the repository at this point in the history
…as#311

 * Small fixes
Farcasut committed Nov 20, 2024
1 parent 5f612fe commit 3be90c6
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -269,12 +269,6 @@
&& $diagram.getAttachment($pngFileName))
#set ($fileName = $pngFileName)
#elseif ($xcontext.action == 'export')
#set ($reference = $xcontext.macro.params.reference)
#if ($stringtool.isEmpty($reference))
#set ($reference = $services.model.createDocumentReference('Diagram', $doc.documentReference.parent))
#else
#set ($reference = $services.model.resolveDocument($reference))
#end
#set ($diagram = $xwiki.getDocument($reference))
#set ($output = "{{html}}<div>$diagram.getAttachment('diagram.svg').getContentAsString()</div>{{/html}}")
#else
Original file line number Diff line number Diff line change
@@ -47,15 +47,13 @@
#end
{{html clean="false"}}
## Check if the query contains the parameter for getting the diagram from URL.

#set ($dispalyDiv = "show")
#if ($xcontext.action == "export")
#set ($displayDiv = "hidden")
#set ($displayDiv = "")
#if ($xcontext.action == 'export')
#set ($displayDiv = 'hidden')
<div>
$doc.getAttachment('diagram.svg').getContentAsString()
$doc.getAttachment('diagram.svg').getContentAsString()
<div>
#end

<div class="diagram $displayDiv"
data-diagram-config="$escapetool.xml($jsontool.serialize($diagramConfig))"
data-toolbar="$escapetool.xml($toolbar)"

0 comments on commit 3be90c6

Please sign in to comment.