From ab6dbf1523c776b35717819abb821388050ca4ec Mon Sep 17 00:00:00 2001 From: Alexander Wagner Date: Mon, 11 Nov 2024 13:55:46 +0100 Subject: [PATCH] Bug 37325: fix XSLT for automatic punctuation of 260 XSLT uses subfields for display _as they are_. Sometimes, these values are used to build queries against Koha based on the field content. These queries may hold punctuation chars that could potentially confuse the search. - Add simple rules to strip punctuation chars in the search terms for OPAC and intranet interfaces. Test plan: 1. Call up any record holding a 260 field in Koha 2. Check the URLs of queries generated from the subfields of 260. These show search terms including punctuation chars (`,:` etc., e.g. `Edinburg :`) 3. Apply the patch 4. Punctuation chars should vanish from the URL and only the search term should survive (e.g. `Edinburg`) This fix acts on _all_ records and is not restricted to records that got their punctuation automatically. Sponsored-by: Deutsches Elektronen-Synchrotron DESY, Library --- .../en/xslt/MARC21slim2intranetDetail.xsl | 66 +++++++++++++++---- .../en/xslt/MARC21slim2intranetResults.xsl | 36 +++++++++- .../en/xslt/MARC21slim2OPACDetail.xsl | 50 +++++++++++--- .../en/xslt/MARC21slim2OPACResults.xsl | 36 +++++++++- 4 files changed, 161 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index cc231f4160..887306b097 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -46,6 +46,7 @@ + @@ -300,22 +301,50 @@ - - /cgi-bin/koha/catalogue/search.pl?q=pl:"" - - + + + + /cgi-bin/koha/opac-search.pl?q=pl:"" + + + - - /cgi-bin/koha/catalogue/search.pl?q=Provider:"" - - + + + + + /cgi-bin/koha/opac-search.pl?q=Provider:"" + + + + - - /cgi-bin/koha/catalogue/search.pl?q=copydate:"" - - + + + + /cgi-bin/koha/opac-search.pl?q=copydate:"" + + + + + + + + + + + + + + + + + + + + @@ -324,11 +353,20 @@ - - + + + + + ; + + + + . + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 58faae0eac..1b5e89f0f2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -32,6 +32,7 @@ + @@ -876,13 +877,38 @@ a - + + + + b - + + + + + + + + + + + + + + + + + + + + + + + @@ -891,6 +917,12 @@ ; + + + + . + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl index de21d62386..5951ac0506 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -48,6 +48,7 @@ + @@ -337,6 +338,7 @@ 1 + Publication details: @@ -344,16 +346,19 @@ - /cgi-bin/koha/opac-search.pl?q=pl:"" - + + /cgi-bin/koha/opac-search.pl?q=pl:"" + - /cgi-bin/koha/opac-search.pl?q=Provider: - + + + /cgi-bin/koha/opac-search.pl?q=Provider:"" + @@ -361,11 +366,29 @@ - /cgi-bin/koha/opac-search.pl?q=copydate:"" - + + /cgi-bin/koha/opac-search.pl?q=copydate:"" + + + + + + + + + + + + + + + + + + @@ -375,11 +398,20 @@ - - - + + + + + + ; + + + + . + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 17676f19a5..17aa719683 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -45,6 +45,7 @@ + @@ -1099,7 +1100,10 @@ - + + + + @@ -1107,7 +1111,28 @@ - + + + + + + + + + + + + + + + + + + + + + + @@ -1117,7 +1142,14 @@ + ; + + + + . + + ; -- 2.39.5