Bugzilla – Attachment 36171 Details for
Bug 13762
biblionumber field and subfield can be called once in authorities merge
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13762 - biblionumber field and subfield can be called once in authorities merge
Bug-13762---biblionumber-field-and-subfield-can-be.patch (text/plain), 3.51 KB, created by
Fridolin Somers
on 2015-02-25 17:30:31 UTC
(
hide
)
Description:
Bug 13762 - biblionumber field and subfield can be called once in authorities merge
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2015-02-25 17:30:31 UTC
Size:
3.51 KB
patch
obsolete
>From 9ae4c570e0f9e05c96cc6741a016919769e689a1 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 25 Feb 2015 18:25:13 +0100 >Subject: [PATCH] Bug 13762 - biblionumber field and subfield can be called > once in authorities merge > >In AuthoritiesMarc::merge, the call of > GetMarcFromKohaField( "biblio.biblionumber", '' ) >is into several foreach loops. >This call can be extracted to be executed only once. >Also, the biblionumber of each record can be stored in @reccache to avoid finding it twice. > >Test plan : >- Set syspref dontmerge to 'Do' >- Merging 2 authoritites >- Check linked biblio records are impacted >- Change an authority heading >- Check linked biblio records are impacted >--- > C4/AuthoritiesMarc.pm | 32 +++++++++++++------------------- > 1 file changed, 13 insertions(+), 19 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 34151fc..7aecc86 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1461,7 +1461,9 @@ sub merge { > @record_to = $MARCto->field($auth_tag_to_report_to)->subfields() if $MARCto->field($auth_tag_to_report_to); > my @record_from; > @record_from = $MARCfrom->field($auth_tag_to_report_from)->subfields() if $MARCfrom->field($auth_tag_to_report_from); >- >+ >+ my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); >+ > my @reccache; > # search all biblio tags using this authority. > #Getting marcbiblios impacted by the change. >@@ -1482,12 +1484,14 @@ sub merge { > 'biblioserver', > $oResult->record($z)->raw() > ); >- my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); >- my $i = ($biblionumbertagfield < 10) >+ my $biblionumber = ( $biblionumbertagfield < 10 ) > ? $marcrecordzebra->field( $biblionumbertagfield )->data > : $marcrecordzebra->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); >- my $marcrecorddb = GetMarcBiblio($i); >- push @reccache, $marcrecorddb; >+ my $marcrecorddb = GetMarcBiblio($biblionumber); >+ push @reccache, { >+ biblionumber => $biblionumber, >+ marcrecord => $marcrecorddb, >+ }; > $z++; > } > $oResult->destroy(); >@@ -1509,8 +1513,10 @@ sub merge { > } > # BulkEdit marc records > # May be used as a template for a bulkedit field >- foreach my $marcrecord(@reccache){ >- my $update; >+ foreach ( @reccache ) { >+ my $biblionumber = $_->{'biblionumber'}; >+ my $marcrecord = $_->{'marcrecord'}; >+ my $update; > foreach my $tagfield (@tags_using_authtype){ > # warn "tagfield : $tagfield "; > foreach my $field ($marcrecord->field($tagfield)){ >@@ -1536,18 +1542,6 @@ sub merge { > } > }#for each tag > }#foreach tagfield >- my ($bibliotag,$bibliosubf) = GetMarcFromKohaField("biblio.biblionumber","") ; >- my $biblionumber; >- if ($bibliotag<10){ >- $biblionumber=$marcrecord->field($bibliotag)->data; >- } >- else { >- $biblionumber=$marcrecord->subfield($bibliotag,$bibliosubf); >- } >- unless ($biblionumber){ >- warn "pas de numéro de notice bibliographique dans : ".$marcrecord->as_formatted; >- next; >- } > if ($update==1){ > &ModBiblio($marcrecord,$biblionumber,GetFrameworkCode($biblionumber)) ; > $counteditedbiblio++; >-- >2.1.0
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 13762
: 36171