From a9cb5fa1ee0a773164e962ff9616685042a8dff5 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Thu, 1 Apr 2010 16:07:25 +0200 Subject: [PATCH] Bug 6001 : batchRebuildBiblioTables.pl doesn't crash anymore when GetMarcBiblio fails. Unprocessed biblionumbers are displayed at the end of the execution instead. Signed-off-by: Henri-Damien LAURENT Signed-off-by: Paul Poulain Signed-off-by: Chris Cormack --- misc/batchRebuildBiblioTables.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/batchRebuildBiblioTables.pl b/misc/batchRebuildBiblioTables.pl index b15a91ade7..ae4f54eab2 100755 --- a/misc/batchRebuildBiblioTables.pl +++ b/misc/batchRebuildBiblioTables.pl @@ -58,9 +58,14 @@ my $sth = $dbh->prepare("SELECT biblionumber FROM biblio"); $sth->execute; # my ($biblionumbermax) = $sth->fetchrow; # warn "$biblionumbermax <<=="; +my @errors; while (my ($biblionumber)= $sth->fetchrow) { #now, parse the record, extract the item fields, and store them in somewhere else. my $record = GetMarcBiblio($biblionumber); + if (not defined $record) { + push @errors, $biblionumber; + next; + } my @fields = $record->field($tagfield); my @items; my $nbitems=0; @@ -82,6 +87,9 @@ while (my ($biblionumber)= $sth->fetchrow) { # $dbh->do("unlock tables"); my $timeneeded = time() - $starttime; print "$i MARC record done in $timeneeded seconds\n"; +if (scalar(@errors) > 0) { + print "Some biblionumber could not be processed though: ", join(" ", @errors); +} # modified NEWmodbiblio to jump the MARC part of the biblio modif # highly faster -- 2.39.5