Skip to content

500 error when editing #238 #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion filter/xsl/filter_put.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
<xsl:template name="replace_nodes">
<xsl:param name="text"/>
<!-- Wrap contents in a temporary <div> root element and parse XML -->
<xsl:variable name="fragment">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;<xsl:value-of select="replace(replace(replace($text, '&amp;(\s)', '&amp;amp;$1'), '&amp;nbsp;', ' '), '&lt;br&gt;', '&lt;br/&gt;')"/>&lt;/div&gt;</xsl:variable>
<xsl:variable name="fragment">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;<xsl:value-of select="replace(replace(replace($text, '&amp;', '&amp;amp;'), '&amp;nbsp;', ' '), '&lt;br&gt;', '&lt;br/&gt;')"/>&lt;/div&gt;</xsl:variable>
<xsl:for-each select="parse-xml($fragment)/h:div">
<xsl:apply-templates/>
</xsl:for-each>
Expand Down
5 changes: 5 additions & 0 deletions forms/edit-form-head.xml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@
</xf:bind>
<!--<xf:bind nodeset="instance('data-instance')//m:revisionDesc/m:change/@isodate" type="xs:dateTime"/>-->

<xf:instance id="tempeditor">
<data>
<index/>
</data>
</xf:instance>
</xf:model>

<!-- XBL components -->
Expand Down
18 changes: 18 additions & 0 deletions forms/includes/topmenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
<!--<xf:action if="instance('parameters')/dcm:automatic_log_main_switch='true'">
<xf:setvalue ref="instance('data-instance')/m:meiHead/m:revisionDesc/m:change[last()]/@isodate" value="now()"/>
</xf:action>-->
<xf:var name="nodes"
select="instance('data-instance')//m:annot[@type='general_description']"/>
<xf:var name="count" select="count($nodes)"/>

<xf:setvalue ref="instance('tempeditor')/index" value="1"/>
<xf:action while="instance('tempeditor')/index &lt;= $count">
<!-- Get current position -->
<xf:var name="pos" select="instance('tempeditor')/index"/>

<!-- Apply replacement to current annotation -->
<xf:setvalue
ref="$nodes[position() = $pos]"
value="replace($nodes[position() = $pos], '&amp;amp;', '&amp;')" />

<!-- Increment counter -->
<xf:setvalue ref="instance('tempeditor')/index" value="$pos + 1"/>
</xf:action>

<xf:dispatch name="language-update" target="form-group"/>
<xf:send submission="save-to-file"/>
<xf:setvalue ref="instance('temp')/changed" value="'false'"/>
Expand Down
Loading