Bugzilla – Attachment 185309 Details for
Bug 40569
Quotation marks in series fields (490/830) break XSLT search links in Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40569: Escape quotation marks in series fields in XSLT search links (Elasticsearch)
Bug-40569-Escape-quotation-marks-in-series-fields-.patch (text/plain), 3.77 KB, created by
Slava Shishkin
on 2025-08-11 13:10:25 UTC
(
hide
)
Description:
Bug 40569: Escape quotation marks in series fields in XSLT search links (Elasticsearch)
Filename:
MIME Type:
Creator:
Slava Shishkin
Created:
2025-08-11 13:10:25 UTC
Size:
3.77 KB
patch
obsolete
>From ca94db0347655057c19b75be8d1c401068a200c7 Mon Sep 17 00:00:00 2001 >From: Slava Shishkin <slavashishkin@gmail.com> >Date: Thu, 31 Jul 2025 20:51:35 +0300 >Subject: [PATCH] Bug 40569: Escape quotation marks in series fields in XSLT > search links (Elasticsearch) > >1. Choose Elasticsearch like Search engine: cgi-bin/koha/admin/preferences.pl?op=search&searchfield=SearchEngine >2. Create or edit a bibliographic record (beter more then one) >3. In field 490$a or 830$a, enter a series name with quotes, e.g. Test "Series" >4. Save the record >5. On the detail page, click the Series link (generated from the XSLT view)Series: Test "Series" >6. The search fails or returns an error due to malformed query >7. Apply the patch >8. Reload the bibliographic detail page >9. Click the Series link again >10. The search should return matching records >--- > .../prog/en/xslt/MARC21slimUtils.xsl | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index b30efc0e069..4cfd050fd63 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -413,7 +413,10 @@ > <span class="results_summary series"><span class="label">Series: </span> > <!-- 440 --> > <xsl:for-each select="marc:datafield[@tag=440 and @ind1!='z']"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:<xsl:call-template name="quote_search_term"> >+ <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code='a']"/></xsl:with-param> >+ </xsl:call-template> >+ </xsl:attribute> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> > <xsl:call-template name="subfieldSelect"> >@@ -438,7 +441,10 @@ > > <!-- 490 Series not traced, Ind1 = 0 --> > <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:<xsl:call-template name="quote_search_term"> >+ <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code='a']"/></xsl:with-param> >+ </xsl:call-template> >+ </xsl:attribute> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> > <xsl:call-template name="subfieldSelect"> >@@ -538,7 +544,10 @@ > </a> > </xsl:when> > <xsl:otherwise> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:<xsl:call-template name="quote_search_term"> >+ <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code='a']"/></xsl:with-param> >+ </xsl:call-template> >+ </xsl:attribute> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> > <xsl:call-template name="subfieldSelect"> >-- >2.50.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40569
:
184944
| 185309