From: Ian Walls <[email protected]>

If an author's name includes parentheses or other escape-characters, the 
tracing links
produced in the OPAC and staff client fail in XSLT mode.  This patch wraps the 
author names
in double-quotes, providing the necessary escapement.

Signed-off-by: Katrin Fischer <[email protected]>
Test plan:
- Create a new framework, delete Thesaurus from 700 and other fields
- Create a new record in this framework
- Add 700$a - use parentheses
- Check the search links in OPAC and staff detail pages
> before patch link was broken, after it works

Note: Links are only broken when no authorities are being used.
When using authorities the link uses the auth number instead of the text
for linking, so the parentheses don't matter for search.
---
 .../prog/en/xslt/MARC21slim2intranetDetail.xsl     |    2 +-
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl         |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl 
b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
index 93ae4b4..b0de609 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
@@ -847,7 +847,7 @@
                 <xsl:attribute 
name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of 
select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-            <xsl:attribute 
name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of 
select="marc:subfield[@code='a']"/></xsl:attribute>
+            <xsl:attribute 
name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of 
select="marc:subfield[@code='a']"/>"</xsl:attribute>
             </xsl:otherwise>
         </xsl:choose>
        <xsl:choose>
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl 
b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
index 2e4228f..e16db73 100755
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
@@ -137,7 +137,7 @@
                 <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of 
select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-            <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of 
select="marc:subfield[@code='a']"/></xsl:attribute>
+            <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of 
select="marc:subfield[@code='a']"/>"</xsl:attribute>
             </xsl:otherwise>
         </xsl:choose>
         <xsl:call-template name="nameABCDQ"/></a>
@@ -152,7 +152,7 @@
                 <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of 
select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-            <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of 
select="marc:subfield[@code='a']"/></xsl:attribute>
+            <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of 
select="marc:subfield[@code='a']"/>"</xsl:attribute>
             </xsl:otherwise>
         </xsl:choose>
         <xsl:call-template name="nameABCDN"/></a>
@@ -174,7 +174,7 @@
                 <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of 
select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-            <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of 
select="marc:subfield[@code='a']"/></xsl:attribute>
+            <xsl:attribute 
name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of 
select="marc:subfield[@code='a']"/>"</xsl:attribute>
             </xsl:otherwise>
         </xsl:choose>
         <xsl:call-template name="nameACDEQ"/></a>
-- 
1.7.5.4

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to