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) {
print "Bib $biblionumber ($title): $headings_changed headings changed\n";
}
if (not $test_only) {
+ # delete any item tags
+ my ($itemtag, $itemsubfield) = GetMarcFromKohaField("items.itemnumber", '');
+ foreach my $field ($bib->field($itemtag)) {
+ $bib->delete_field($field);
+ }
ModBiblio($bib, $biblionumber, GetFrameworkCode($biblionumber));
$num_bibs_modified++;
}
--test only test the authority linking
and report the results; do not
change the bib records.
- --comment <comment> optional comment to describe
- the record batch; if the comment
- has spaces in it, surround the
- comment with quotation marks.
--help or -h show this message.
_USAGE_
}