Bugzilla – Attachment 43124 Details for
Bug 14560
Introduce a way of handling Rameau composed authorities, without breaking normal workflow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14560 [Follow-up]: QA: Add debug warnings and get biblionumber with GetMarcFromKohaField
Bug-14560-Follow-up-QA-Add-debug-warnings-and-get-.patch (text/plain), 2.45 KB, created by
Matthias Meusburger
on 2015-10-05 13:04:39 UTC
(
hide
)
Description:
Bug 14560 [Follow-up]: QA: Add debug warnings and get biblionumber with GetMarcFromKohaField
Filename:
MIME Type:
Creator:
Matthias Meusburger
Created:
2015-10-05 13:04:39 UTC
Size:
2.45 KB
patch
obsolete
>From 70ca93fdf0f9d066ebd1de1930f534c07fcc4d9d Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Mon, 5 Oct 2015 15:03:14 +0200 >Subject: [PATCH] Bug 14560 [Follow-up]: QA: Add debug warnings and get > biblionumber with GetMarcFromKohaField > >--- > C4/AuthoritiesRameau.pm | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesRameau.pm b/C4/AuthoritiesRameau.pm >index c1ad3f4..ecb2038 100644 >--- a/C4/AuthoritiesRameau.pm >+++ b/C4/AuthoritiesRameau.pm >@@ -27,6 +27,7 @@ use C4::AuthoritiesMarc::MARC21; > use C4::AuthoritiesMarc::UNIMARC; > use C4::Charset; > use C4::Log; >+use C4::Debug; > use Koha::Authority; > > use vars qw($VERSION @ISA @EXPORT); >@@ -85,7 +86,7 @@ sub _findLocalAuth { > $rs = $ctn->search(new ZOOM::Query::CCL2RPN(C4::Context->preference('rameauBnfIdIndex') . '=' . $id, $ctn)); > }; > if ($@) { >- print "Error searching\n"; >+ $debug and warn "Error searching"; > return -1; > } > if ($rs && $rs->size() == 1) { >@@ -133,7 +134,7 @@ sub addInternalLinks { > if (my $kohaauthid = _findLocalAuth($subfield->[1])) { > if ($kohaauthid != -1) { > $found_authid = $kohaauthid; >- print "Adding authid $kohaauthid\n"; >+ $debug and warn "Adding authid $kohaauthid"; > } > } > } >@@ -149,14 +150,25 @@ sub rameauProcessing { > my $marcrecord = shift @_; > my $update = 0; > >+ # Getting biblionumber >+ my ($bntag, $bnsubf) = GetMarcFromKohaField('biblio.biblionumber', ''); >+ my $biblionumber; >+ if (defined $bnsubf && $bnsubf ne "@") { >+ $biblionumber = $marcrecord->subfield($bntag, $bnsubf); >+ } else { >+ if (defined $marcrecord->field($bntag)) { >+ $biblionumber = $marcrecord->field($bntag)->data(); >+ } >+ } >+ > my @rameauFields = (600, 601, 602, 606, 607); > foreach my $tag (@rameauFields) { > foreach my $field ($marcrecord->field($tag)) { > if (isRameau($field)) { >- if ($marcrecord->field('001')) { >- print "Merging Rameau for biblionumber " . $marcrecord->field('001')->data() . " field $tag\n"; >+ if (defined $biblionumber) { >+ $debug and warn "Merging Rameau for biblionumber $biblionumber field $tag"; > } else { >- print "Merging Rameau for an unknown biblionumber field $tag\n"; >+ $debug and warn "Merging Rameau for an unknown biblionumber field $tag"; > } > addRameau($field); > addInternalLinks($field); >-- >1.7.10.4
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 14560
:
41072
|
41342
|
43124
|
58871
|
58872
|
58873