During link_bibs_to_authorities.pl run, a bib was
observed that had both biblioitems.marc and biblioitems.marcxml
set to blank or NULL. Added check to verify that a
defined value is returned from GetMarcBiblio(); may follow
up with additional patches once it's determined how
the corrupt bib came to be loaded.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
my $num_bibs_processed = 0;
my $num_bibs_modified = 0;
+my $num_bad_bibs = 0;
my $dbh = C4::Context->dbh;
$dbh->{AutoCommit} = 0;
process_bibs();
------------------------------------
Number of bibs checked: $num_bibs_processed
Number of bibs modified: $num_bibs_modified
+Number of bibs with errors: $num_bad_bibs
_SUMMARY_
}
my $biblionumber = shift;
my $bib = GetMarcBiblio($biblionumber);
+ unless (defined $bib) {
+ print "\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
+ $num_bad_bibs++;
+ return;
+ }
+
my $headings_changed = LinkBibHeadingsToAuthorities($bib);
if ($headings_changed) {