Bugzilla – Attachment 32964 Details for
Bug 13163
Duplicate records in Zebra after editing NORMARC records with DOM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13163: NORMARC DOM config missing <id> entry
Bug-13163-NORMARC-DOM-config-missing-id-entry.patch (text/plain), 2.87 KB, created by
Frédéric Demians
on 2014-10-30 07:57:28 UTC
(
hide
)
Description:
Bug 13163: NORMARC DOM config missing <id> entry
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2014-10-30 07:57:28 UTC
Size:
2.87 KB
patch
obsolete
>From 7901bbc7d6bccee2860d15c401804b9bef042b8a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 28 Oct 2014 21:07:43 -0300 >Subject: [PATCH] Bug 13163: NORMARC DOM config missing <id> entry > >This patch fixes the biblio-koha-indexdefs.xml for NORMARC, so >it includes the <id> element. > >Because of how our DOM files work, the resulting biblio-zebra-indexdefs.xsl >for NORMARC picked the whole MARC record as ID, so every time the record >was edited, the id wouldn't match and a new record was created. > >To test: >- Have a MARCXML record >- run: > $ xsltproc etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl the_record | less >=> FAIL: verify the z:id property on the <z:record> line contains all subfields concatenated >- Apply the patch >- re-run the xsltproc line >=> SUCCESS: z:id contains the 999$c number >- Sign off :-D > >Regards > >Signed-off-by: Frederic Demians <f.demians@tamil.fr> > >Known bug with DOM: Without <z:id> indexing biblionumber Zebra hasn't it record >unique ID, and so fails to identify existing records. Works as described. 999$c >is linked to biblionumber in default Normarc framework. >--- > etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml | 1 + > etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > >diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >index d2aef1a..5ce689f 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >@@ -1,6 +1,7 @@ > <?xml version="1.0" encoding="utf-8"?> > <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs" > xmlns="http://www.koha-community.org/schemas/index-defs"> >+ <id>marc:datafield[@tag='999']/marc:subfield[@code='c']</id> > <!--record.abs line 64: xelm /record/leader llength:w:range(data,0,5),rtype:w:range(data,6,1),Bib-level:w:range(data,7,1)--> > <index_leader offset="0" length="5"> > <target_index>llength:w</target_index> >diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >index 064c8a8..56d006b 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >@@ -28,7 +28,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:template> > <xslo:template match="marc:record"> >- <xslo:variable name="idfield" select="normalize-space()"/> >+ <xslo:variable name="idfield" select="normalize-space(marc:datafield[@tag='999']/marc:subfield[@code='c'])"/> > <z:record type="update"> > <xslo:attribute name="z:id"> > <xslo:value-of select="$idfield"/> >-- >2.1.2
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 13163
:
32937
|
32964
|
32967
|
33104