Bugzilla – Attachment 41132 Details for
Bug 14597
Reverting a batch where a record overlaid is now deleted will fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14597 - Reverting a batch where a record overlaid a now deleted record will fail
Bug-14597---Reverting-a-batch-where-a-record-overl.patch (text/plain), 2.45 KB, created by
Kyle M Hall (khall)
on 2015-07-23 16:23:49 UTC
(
hide
)
Description:
Bug 14597 - Reverting a batch where a record overlaid a now deleted record will fail
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-07-23 16:23:49 UTC
Size:
2.45 KB
patch
obsolete
>From 75db4022cece16ab0d766c9886796bcd8b573054 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 23 Jul 2015 12:14:25 -0400 >Subject: [PATCH] Bug 14597 - Reverting a batch where a record overlaid a now deleted record will fail > >If batch of records is used to overlay existing records, and one of >those records is deleted, any attempt to revert this batch will fail. > >The unanimous consensus is that deleted records should stay deleted ( > https://lists.katipo.co.nz/public/koha/2015-June/043048.html ). > >Test Plan: >1) Import a batch of records >2) Import the same batch again, using ISBN as a matcher for overlay >3) Find a record that overlayed a previous record and delete it > ( the match type will be "match applied" and there will be a link in > "match details" ) >4) Attempt to revert the second batch ( that overlayed the first ) >5) The progress will stop at some point and never complete >6) Apply this patch >7) Attempt to revert the second batch again >8) This time it should succeed! >--- > C4/ImportBatch.pm | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 29a1f94..9f9c91c 100644 >--- a/C4/ImportBatch.pm >+++ b/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 { >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14597
:
41131
|
41132
|
41133
|
41134
|
41170
|
42699
|
42900
|
42901
|
42902