From 66f446924d833142e8ad8d2601e155af66ceffa2 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Mon, 6 Aug 2012 15:01:09 +0200 Subject: [PATCH] Bug 8576: Software error on authority edition when using merge --- C4/AuthoritiesMarc.pm | 2 +- misc/batchImportMARCWithBiblionumbers.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 21ebd94..1f440df 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1356,7 +1356,7 @@ sub merge { my $marcdata = $rec->raw(); 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 $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); my $marcrecorddb=GetMarcBiblio($i); push @reccache, $marcrecorddb; $z++; diff --git a/misc/batchImportMARCWithBiblionumbers.pl b/misc/batchImportMARCWithBiblionumbers.pl index 4acc02b..3c46a6b 100755 --- a/misc/batchImportMARCWithBiblionumbers.pl +++ b/misc/batchImportMARCWithBiblionumbers.pl @@ -56,7 +56,7 @@ my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField("biblio.biblionumbe my $i=0; while ( my $record = $batch->next() ) { - my $biblionumber=$record->field($tagfield)->subfield($biblionumtagsubfield); + my $biblionumber = ($tagfield < 10) ? $record->field($tagfield)->data : $record->subfield($tagfield, $biblionumtagsubfield); $i++; $sth2->execute($record->as_usmarc,$biblionumber) if $biblionumber; print "$biblionumber \n"; -- 1.7.9.5