[Koha-cvs] CVS: koha/C4 Biblio.pm,1.102,1.103

Paul POULAIN tipaul at users.sourceforge.net
Mon Sep 6 16:17:51 CEST 2004


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8423/C4

Modified Files:
	Biblio.pm 
Log Message:
some commented warning added + 1 major bugfix => drop empty fields, NOT fields containing 0

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -r1.102 -r1.103
*** Biblio.pm	6 Sep 2004 10:00:19 -0000	1.102
--- Biblio.pm	6 Sep 2004 14:17:34 -0000	1.103
***************
*** 411,419 ****
        )
        = @_;
! 
      # if not value, end of job, we do nothing
!     if ( length($subfieldvalues) == 0 ) {
!         return;
!     }
      if ( not($subfieldcode) ) {
          $subfieldcode = ' ';
--- 411,419 ----
        )
        = @_;
! # warn "$tagid / $subfieldcode / $subfieldvalues";
      # if not value, end of job, we do nothing
! #     if ( length($subfieldvalues) == 0 ) {
! #         return;
! #     }
      if ( not($subfieldcode) ) {
          $subfieldcode = ' ';
***************
*** 1038,1041 ****
--- 1038,1042 ----
  	for (my $i=0; $i< @$rtags; $i++) {
  		# rebuild MARC::Record
+ # 			warn "0=>".@$rtags[$i].@$rsubfields[$i]." = ".@$rvalues[$i].": ";
  		if (@$rtags[$i] ne $prevtag) {
  			if ($prevtag < 10) {
***************
*** 1053,1056 ****
--- 1054,1058 ----
  			} else {
  				$field = MARC::Field->new( (sprintf "%03s",@$rtags[$i]), substr($indicators{@$rtags[$i]},0,1),substr($indicators{@$rtags[$i]},1,1), @$rsubfields[$i] => @$rvalues[$i]);
+ # 			warn "1=>".@$rtags[$i].@$rsubfields[$i]." = ".@$rvalues[$i].": ".$field->as_formatted;
  			}
  			$prevtag = @$rtags[$i];
***************
*** 1059,1064 ****
  				$prevvalue=@$rvalues[$i];
  			} else {
! 				if (@$rvalues[$i]) {
  					$field->add_subfields(@$rsubfields[$i] => @$rvalues[$i]);
  				}
  			}
--- 1061,1067 ----
  				$prevvalue=@$rvalues[$i];
  			} else {
! 				if (length(@$rvalues[$i])>0) {
  					$field->add_subfields(@$rsubfields[$i] => @$rvalues[$i]);
+ # 			warn "2=>".@$rtags[$i].@$rsubfields[$i]." = ".@$rvalues[$i].": ".$field->as_formatted;
  				}
  			}
***************
*** 1068,1071 ****
--- 1071,1075 ----
  	# the last has not been included inside the loop... do it now !
  	$record->add_fields($field);
+ # 	warn "HTML2MARC=".$record->as_formatted;
  	return $record;
  }
***************
*** 2537,2540 ****
--- 2541,2547 ----
  # $Id$
  # $Log$
+ # Revision 1.103  2004/09/06 14:17:34  tipaul
+ # some commented warning added + 1 major bugfix => drop empty fields, NOT fields containing 0
+ #
  # Revision 1.102  2004/09/06 10:00:19  tipaul
  # adding a "location" field to the library.





More information about the Koha-cvs mailing list