Bugzilla – Attachment 121907 Details for
Bug 19220
Allow XSLT processing for Z39.50 authority targets like for bibliographic targets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19220 Allow XSLT processing for Z39.50 authority version 1
0001-Bug-19220-Allow-XSLT-processing-for-Z39.50-authority.patch (text/plain), 2.58 KB, created by
Filippos Kolovos
on 2021-06-14 06:56:54 UTC
(
hide
)
Description:
Bug 19220 Allow XSLT processing for Z39.50 authority version 1
Filename:
MIME Type:
Creator:
Filippos Kolovos
Created:
2021-06-14 06:56:54 UTC
Size:
2.58 KB
patch
obsolete
>From bb81900fba721b404188814d11422dc6d32c3b48 Mon Sep 17 00:00:00 2001 >From: Filippos N Kolovos <f.kolovos@gmail.com> >Date: Sun, 13 Jun 2021 19:23:06 +0300 >Subject: [PATCH 1/2] Bug 19220 | Allow XSLT processing for Z39.50 authority > targets like for bibliographic targets > >Work in this file includes a bugfix when a custom XSLT transform file has been configured for an authority Z3950 server >but when the search has been previously carried out, the XSLT seems not to be working. One had to run the cleanup_database.pl tool -c --z3950 >in order to clean the import tables for this to work. Similarly, if an XSLT was working and now it is removed from the configuration, then the same behaviour occurs >where an "old" search still comes out formatted with the XSLT. > >It is in the ImportBreedingAuth() method, where for the Authorities if an import_record_id already exists in the import_records table for that authority in >the import_auths table, then it simply returns the import_record_id, ignoring the new MARC data that have been returned from the new XSL transformation. >If the auth record does not exist in the import_auths table, then the AddAuthToBatch() is called, which adds the auth into import_records, with the marc >and marcxml correctly. > >In the case of biblios, it always runs the AddBiblioToBatch(), even if the biblio is already in the cache, returning the new id, hence the new marc. >--- > C4/Breeding.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 6b103b3cdb..a606acc579 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -502,6 +502,8 @@ sub ImportBreedingAuth { > my $batch_id = GetZ3950BatchId($filename); > my $searchbreeding = $dbh->prepare("select import_record_id from import_auths where control_number=? and authorized_heading=?"); > >+ my $marc_type = shift || C4::Context->preference('marcflavour'); >+ > my $controlnumber = $marcrecord->field('001')->data; > > # Normalize the record so it doesn't have separated diacritics >@@ -510,7 +512,13 @@ sub ImportBreedingAuth { > $searchbreeding->execute($controlnumber,$heading); > my ($breedingid) = $searchbreeding->fetchrow; > >- return $breedingid if $breedingid; >+ if ($breedingid) >+ { >+ my $updbrd = $dbh->prepare("update import_records set marc=?,marcxml=? where import_record_id=?"); >+ $updbrd->execute($marcrecord->as_usmarc(),$marcrecord->as_xml($marc_type),$breedingid); >+ $updbrd->finish(); >+ return $breedingid; >+ } > $breedingid = AddAuthToBatch($batch_id, 0, $marcrecord, $encoding); > return $breedingid; > } >-- >2.20.1 >
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 19220
:
114604
|
121897
|
121906
|
121907
|
172627
|
172628
|
173438