rebuild_unimarc_100 : better handling of unusual cases
authorPaul POULAIN <paul@koha-fr.org>
Wed, 24 Oct 2007 19:42:10 +0000 (14:42 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 24 Oct 2007 22:08:56 +0000 (17:08 -0500)
If 100$a repeated, the scripts failed to handle that correctly

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
misc/migration_tools/22_to_30/rebuild_unimarc_100.pl

index 61c961a..e428d61 100755 (executable)
@@ -21,9 +21,9 @@ $|=1; # flushes output
 print "Creating/updating field 100 if needed\n";
 while (my ($biblionumber,$time)=$sth->fetchrow ){
 #   my $record;
-print "record : $biblionumber \n";
+print "record : $biblionumber \n";
     my $record = GetMarcBiblio($biblionumber);
-print "=> ".$record->as_formatted;
+print "=> ".$record->as_formatted;
     MARCmodrecord($biblionumber,$record,$time);
 #
 }
@@ -35,7 +35,7 @@ sub MARCmodrecord {
         $record->leader('     nac  22     1u 4500');
         $update=1;
         my $string;
-        if ($record->subfield(100,"a")) {
+        if ($record->field(100)) {
             $string = substr($record->subfield(100,"a")."                                   ",0,35);
             my $f100 = $record->field(100);
             $record->delete_field($f100);