From f014f08365d7cc18d114b66906d9baa608c26d41 Mon Sep 17 00:00:00 2001 From: amillar Date: Wed, 12 Jun 2002 20:25:35 +0000 Subject: [PATCH] fix bug in arrayed subfields --- acqui.simple/marcimport.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/acqui.simple/marcimport.pl b/acqui.simple/marcimport.pl index c428d13d35..6d83267cdc 100755 --- a/acqui.simple/marcimport.pl +++ b/acqui.simple/marcimport.pl @@ -635,11 +635,13 @@ sub extractmarcfields { # see if it is defined in our Marc to koha mapping table if ( $fieldname=$tagmap{ $field->{'tag'} }->{$subfield}->{name} ) { # Yes, so keep the value - $bib->{$fieldname}=$field->{'subfields'}->{$subfield}; + if ( ref($field->{'subfields'}->{$subfield} ) eq 'ARRAY' ) { # if it was an array, just keep first element. - if (ref($bib->{$fieldname}) eq 'ARRAY') { - $bib->{$fieldname}=$$bib->{fieldname}[0] + $bib->{$fieldname}=$field->{'subfields'}->{$subfield}[0]; + } else { + $bib->{$fieldname}=$field->{'subfields'}->{$subfield}; } # if array + print "$field->{'tag'} $subfield $fieldname=$bib->{$fieldname}\n" if $debug; # see if this field should have trailing chars dropped if ($strip=$tagmap{ $field->{'tag'} }->{$subfield}->{striptrail} ) { $strip=~s//\\/; # backquote each char -- 2.39.5