skipping wrong XMLs when rebuilding nozebra indexes
authorPaul POULAIN <paul@koha-fr.org>
Tue, 9 Oct 2007 21:46:49 +0000 (16:46 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 10 Oct 2007 00:11:47 +0000 (19:11 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
misc/migration_tools/rebuild_nozebra.pl

index 4861b51..4ddb2f8 100755 (executable)
@@ -83,16 +83,17 @@ $sth->execute();
 my $i=0;
 my %result;
 while (my ($biblionumber) = $sth->fetchrow) {
-    $i++;
-    print "\r$i";
-    my  $record;
-   eval{
-       $record = GetMarcBiblio($biblionumber);
-   };
-   if($@){
-       print "  There was some pb getting biblionumber : ".$biblionumber."\n";
-       next;
-   }
+        $i++;
+        print "\r$i";
+        my  $record;
+    eval{
+            $record = GetMarcBiblio($biblionumber);
+    };
+    if($@){
+            print "  There was some pb getting biblionumber : ".$biblionumber."\n";
+            next;
+    }
+    next unless $record;
     # get title of the record (to store the 10 first letters with the index)
     my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title');
     my $title = lc($record->subfield($titletag,$titlesubfield));