[Koha-cvs] CVS: koha/acqui.simple marcimport.pl,1.6.2.17,1.6.2.18

Alan Millar amillar at users.sourceforge.net
Wed Jun 12 22:25:37 CEST 2002


Update of /cvsroot/koha/koha/acqui.simple
In directory usw-pr-cvs1:/tmp/cvs-serv22636

Modified Files:
      Tag: rel-1-2
	marcimport.pl 
Log Message:
fix bug in arrayed subfields

Index: marcimport.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/marcimport.pl,v
retrieving revision 1.6.2.17
retrieving revision 1.6.2.18
diff -C2 -r1.6.2.17 -r1.6.2.18
*** marcimport.pl	10 Jun 2002 06:47:17 -0000	1.6.2.17
--- marcimport.pl	12 Jun 2002 20:25:35 -0000	1.6.2.18
***************
*** 636,644 ****
  	    	if ( $fieldname=$tagmap{ $field->{'tag'} }->{$subfield}->{name} ) {
  		    # Yes, so keep the value
! 		    $bib->{$fieldname}=$field->{'subfields'}->{$subfield};
  		    # if it was an array, just keep first element.
! 		    if (ref($bib->{$fieldname}) eq 'ARRAY') {
! 			$bib->{$fieldname}=$$bib->{fieldname}[0]
  		    } # if array
  		    # see if this field should have trailing chars dropped
  	    	    if ($strip=$tagmap{ $field->{'tag'} }->{$subfield}->{striptrail} ) {
--- 636,646 ----
  	    	if ( $fieldname=$tagmap{ $field->{'tag'} }->{$subfield}->{name} ) {
  		    # Yes, so keep the value
! 		    if ( ref($field->{'subfields'}->{$subfield} ) eq 'ARRAY' ) {
  		    # if it was an array, just keep first element.
! 		        $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} ) {





More information about the Koha-cvs mailing list