Bug 6553 - Parentheses in Corporate author break tracings
authorLiz Rea <liz@catalyst.net.nz>
Thu, 9 May 2013 21:32:17 +0000 (09:32 +1200)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 1 Jul 2013 02:06:17 +0000 (19:06 -0700)
To test:

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

Test plan:
- Create a new framework, delete Thesaurus from 100 and other fields
- Create a new record in this framework (or change an existing record to this framework)
- Add 100$a - use parentheses
- Check the search links in OPAC detail pages

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
XSLT change adding quotes. Search now matches search in the intranet.
Passes all tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl

index e1e6546..ad74c53 100644 (file)
             <a>
                 <xsl:choose>
                     <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
-                        <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+                        <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:choose>
             </a>
             <xsl:if test="marc:subfield[@code=9]">
                 <a class='authlink'>
-                    <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+                    <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid="<xsl:value-of select="marc:subfield[@code=9]"/>"</xsl:attribute>
                     <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
                 </a>
             </xsl:if>