Bug 30231: (bug 5927 follow-up) See (rejected) forms of series entry visible in searc...
authorJanusz Kaczmarek <januszop@gmail.com>
Fri, 4 Mar 2022 21:47:11 +0000 (22:47 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 31 Aug 2022 17:34:05 +0000 (14:34 -0300)
When using zebra with IncludeSeeFromInSearches on, with traced series, the rejected
forms (4XX) of series entries are visible in result lists, both in OPAC and intra
interfaces.

Test plan:
=========
1. Have a MARC 21 installation with zebra, and with IncludeSeeFromInSearches on.
   Have an authority records for series (130, or 100/110/111 with
   title) with rejected forms (4XX fields).  So the auth record should
   contain at least:

   130 _0 $a Series title
   430 _0 $a Some other title under which the series in known

   Use (each) authority record in at least two biblio records (in appropriate
   fields, i.e.  800/810/811/830 or even deprecated 440, if it makes use
   of UNIF_TITLE).
   Don't forget to properly input also 490 (for 8XX). So the biblio record
   shold contain at least:

   245 nn $a Work title.
   490 1_ $a Series title
   830 _0 $a Series entry $9 <koha_id>

   Reindex.
2. Perform a simple biblio search (in OPAC and in intra) with the title
   from auth record.
3. You shold get a list of results.  See the Series information--you
   shold see not only the accepted entry from 1XX in auth but also the
   rejected forms from 4XX.
4. Apply the patch.
5. Repeat 3. You shold see only the entry form of series now.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl

index e3271c8..fc29e92 100644 (file)
         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
         <span class="results_summary series"><span class="label">Series: </span>
         <!-- 440 -->
-        <xsl:for-each select="marc:datafield[@tag=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>
             <xsl:call-template name="chopPunctuation">
                             <xsl:with-param name="chopString">
         </xsl:for-each>
         <!-- 490 Series traced, Ind1 = 1 -->
         <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
-            <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811]">
+            <xsl:for-each select="marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z']">
                 <xsl:choose>
                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
                         <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute>
             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose>
             </xsl:for-each>
 
-            <xsl:for-each select="marc:datafield[@tag=830]">
+            <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']">
                 <xsl:choose>
                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
                         <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
index b734afd..98618ce 100644 (file)
         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
         <span class="results_summary series"><span class="label">Series: </span>
         <!-- 440 -->
-        <xsl:for-each select="marc:datafield[@tag=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>
                 <xsl:call-template name="chopPunctuation">
                     <xsl:with-param name="chopString">
         </xsl:for-each>
         <!-- 490 Series traced, Ind1 = 1 -->
         <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
-            <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811]">
+            <xsl:for-each select="marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z']">
                 <xsl:choose>
                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
                         <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute>
             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose>
             </xsl:for-each>
 
-            <xsl:for-each select="marc:datafield[@tag=830]">
+            <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']">
                 <xsl:choose>
                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
                         <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">