From 36d6f725806f383bb5b1c08f0afbc66d94b32d66 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: Chris Cormack --- 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 c12d20b187..ef357dfa63 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1352,7 +1352,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..3c46a6bc31 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