[Koha-patches] [PATCH] Bug 5657 Changes made to sub merge to eliminate errors occuring when updating bibio records in batch (after updating multiple authority records)

Janusz Kaczmarek januszop at gmail.com
Tue Jan 25 19:43:24 CET 2011


---
 C4/AuthoritiesMarc.pm |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm
index e616636..8aee537 100644
--- a/C4/AuthoritiesMarc.pm
+++ b/C4/AuthoritiesMarc.pm
@@ -1299,7 +1299,11 @@ sub merge {
             my $rec;
             $rec=$oResult->record($z);
             my $marcdata = $rec->raw();
-            push @reccache, $marcdata;
+            my $marcrecordzebra= MARC::Record->new_from_xml($marcdata,"utf8",C4::Context->preference("marcflavour"));
+            my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
+            my $i = $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield);
+            my $marcrecorddb=GetMarcBiblio($i);
+            push @reccache, $marcrecorddb;
             $z++;
         }
         $oConnection->destroy();    
@@ -1324,7 +1328,6 @@ sub merge {
     # May be used as a template for a bulkedit field  
     foreach my $marcrecord(@reccache){
         my $update;           
-        $marcrecord= MARC::Record->new_from_xml($marcrecord,"utf8",C4::Context->preference("marcflavour")) unless(C4::Context->preference('NoZebra'));
         foreach my $tagfield (@tags_using_authtype){
 #             warn "tagfield : $tagfield ";
             foreach my $field ($marcrecord->field($tagfield)){
-- 
1.7.2.3



More information about the Koha-patches mailing list