From 88e66b674ec907f8bd7368289678630d76202019 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 Signed-off-by: Chris Cormack Signed-off-by: Paul Poulain --- 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 21ebd949fc..1f440df1a0 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 4acc02b116..24692fda56 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"; -- 2.39.5