@@ -, +, @@ https://lists.katipo.co.nz/public/koha/2015-June/043048.html ). ( the match type will be "match applied" and there will be a link in "match details" ) --- C4/ImportBatch.pm | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -28,6 +28,7 @@ use C4::Charset; use C4::AuthoritiesMarc; use C4::MarcModificationTemplates; use Koha::Plugins::Handler; +use Koha::Logger; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -812,6 +813,9 @@ sub BatchCommitItems { sub BatchRevertRecords { my $batch_id = shift; + my $logger = Koha::Logger->get( { category => 'C4.ImportBatch.BatchRevertRecords' } ); + $logger->trace("C4::ImportBatch::BatchRevertRecords( $batch_id )"); + my $record_type; my $num_deleted = 0; my $num_errors = 0; @@ -867,6 +871,10 @@ sub BatchRevertRecords { if ($record_type eq 'biblio') { my $biblionumber = $rowref->{'matched_biblionumber'}; my $oldbiblio = GetBiblio($biblionumber); + + $logger->info("Biblio record $biblionumber does not exist, restoration of this record was skipped") unless $oldbiblio; + next unless $oldbiblio; # Record has since been deleted. Deleted records should stay deleted. + $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'}); ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'}); } else { --