Bugzilla – Attachment 35612 Details for
Bug 1807
search () give odd results with Zebra and ICU
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 1807: Remove parens from links to fix searches
Bug-1807-Remove-parens-from-links-to-fix-searches.patch (text/plain), 8.27 KB, created by
Nicole C. Engard
on 2015-01-29 20:21:41 UTC
(
hide
)
Description:
Bug 1807: Remove parens from links to fix searches
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2015-01-29 20:21:41 UTC
Size:
8.27 KB
patch
obsolete
>From e9675d997b1597ac7595d388c1914b43eacfbec3 Mon Sep 17 00:00:00 2001 >From: Winona Salesky <wsalesky@gmail.com> >Date: Thu, 29 Jan 2015 14:13:37 -0600 >Subject: [PATCH] Bug 1807: Remove parens from links to fix searches > >This patch will resolve the issue of not being able to >search with parens in a subject heading by editing the xslt > >To test: > >* Apply patch >* Search Koha for a title with ( ) in the subject >* Click the subject >* Results should be returned >* Repeat in OPAC and Staff client >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 28 ++++++++++++++++++- > .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 28 ++++++++++++++++++- > 2 files changed, 52 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 f96c0eb..8f64954 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -3,6 +3,7 @@ > <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> > > <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ --> >+<!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com --> > <xsl:stylesheet version="1.0" > xmlns:marc="http://www.loc.gov/MARC21/slim" > xmlns:items="http://www.koha-community.org/items" >@@ -530,11 +531,12 @@ > <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']"> > <a> > <xsl:choose> >+ <!-- #1807 Strip unwanted parenthesis from subjects for searching --> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> > <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:when test="$TraceSubjectSubdivisions='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect"> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject"> > <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param> > <xsl:with-param name="delimeter"> AND </xsl:with-param> > <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param> >@@ -542,8 +544,9 @@ > </xsl:call-template> > </xsl:attribute> > </xsl:when> >+ <!-- #1807 Strip unwanted parenthesis from subjects for searching --> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="translate(marc:subfield[@code='a'],'()','')"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="chopPunctuation"> >@@ -985,4 +988,25 @@ > </xsl:if> > </xsl:template> > >+ <!-- #1807 Strip unwanted parenthesis from subjects for searching --> >+ <xsl:template name="subfieldSelectSubject"> >+ <xsl:param name="codes"/> >+ <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="subdivCodes"/> >+ <xsl:param name="subdivDelimiter"/> >+ <xsl:param name="prefix"/> >+ <xsl:param name="suffix"/> >+ <xsl:variable name="str"> >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="contains($codes, @code)"> >+ <xsl:if test="contains($subdivCodes, @code)"> >+ <xsl:value-of select="$subdivDelimiter"/> >+ </xsl:if> >+ <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> >+ </xsl:if> >+ </xsl:for-each> >+ </xsl:variable> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:template> >+ > </xsl:stylesheet> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index af9ac00..761b632 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -1,5 +1,6 @@ > <?xml version="1.0" encoding="UTF-8"?> > <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ --> >+<!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com --> > <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> > <xsl:stylesheet version="1.0" > xmlns:marc="http://www.loc.gov/MARC21/slim" >@@ -581,8 +582,9 @@ > <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:when> >+ <!-- #1807 Strip unwanted parenthesis from subjects for searching --> > <xsl:when test="$TraceSubjectSubdivisions='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect"> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelectSubject"> > <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param> > <xsl:with-param name="delimeter"> AND </xsl:with-param> > <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param> >@@ -590,8 +592,9 @@ > </xsl:call-template> > </xsl:attribute> > </xsl:when> >+ <!-- #1807 Strip unwanted parenthesis from subjects for searching --> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="translate(marc:subfield[@code='a'],'()','')"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="chopPunctuation"> >@@ -1173,4 +1176,25 @@ > </xsl:variable> > <xsl:value-of select="substring($str,1,string-length($str)-1)"/> > </xsl:template> >+ >+ <!-- #1807 Strip unwanted parenthesis from subjects for searching --> >+ <xsl:template name="subfieldSelectSubject"> >+ <xsl:param name="codes"/> >+ <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="subdivCodes"/> >+ <xsl:param name="subdivDelimiter"/> >+ <xsl:param name="prefix"/> >+ <xsl:param name="suffix"/> >+ <xsl:variable name="str"> >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="contains($codes, @code)"> >+ <xsl:if test="contains($subdivCodes, @code)"> >+ <xsl:value-of select="$subdivDelimiter"/> >+ </xsl:if> >+ <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> >+ </xsl:if> >+ </xsl:for-each> >+ </xsl:variable> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:template> > </xsl:stylesheet> >-- >1.7.2.3
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 1807
:
370
|
371
|
35612
|
35646