https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14332

Tomás Cohen Arazi <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #8 from Tomás Cohen Arazi <[email protected]> ---
This implementation is causing some troubles because the
koha-indexdefs-to-zebra.xsl is by no means MARC21-only or even biblio-only.

To reproduce:
- On current master, run:
  $ xsltproc etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl
etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >
etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl
- Run:
  $ git diff
=> FAIL: The following is added to
etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl, thus UNIMARC
field 245 is being sent to the Title index

@@ -42,6 +43,7 @@ definition file (probably something like
{biblio,authority}-koha-indexdefs.xml)
       <xslo:apply-templates mode="index_match_heading"/>
       <xslo:apply-templates mode="index_subject_thesaurus"/>
       <xslo:apply-templates mode="index_all"/>
+      <xslo:apply-templates mode="index_sort_tit"/>
     </z:record>
   </xslo:template>
   <xslo:template match="marc:controlfield[@tag='001']">
@@ -2681,6 +2683,19 @@ definition file (probably something like
{biblio,authority}-koha-indexdefs.xml)
       <xslo:value-of select="."/>
     </z:index>
   </xslo:template>
+  <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']">
+    <xslo:variable name="chop">
+      <xslo:choose>
+        <xslo:when test="not(number(@ind2))">0</xslo:when>
+        <xslo:otherwise>
+          <xslo:value-of select="number(@ind2)"/>
+        </xslo:otherwise>
+      </xslo:choose>
+    </xslo:variable>
+    <z:index name="Title:s">
+      <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
+    </z:index>
+  </xslo:template>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to