Bugzilla – Attachment 17910 Details for
Bug 9231
Batch revert staged MARC records fails if one or more records in a batch have been deleted.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9231 - Batch revert staged MARC records fails if one or more records in a batch have been deleted.
Bug-9231---Batch-revert-staged-MARC-records-fails-.patch (text/plain), 1.71 KB, created by
Kyle M Hall
on 2013-05-02 18:34:42 UTC
(
hide
)
Description:
Bug 9231 - Batch revert staged MARC records fails if one or more records in a batch have been deleted.
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2013-05-02 18:34:42 UTC
Size:
1.71 KB
patch
obsolete
>From e3e4764945d06b578ea16555c078389acc85ca22 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 18 Dec 2012 07:47:09 -0500 >Subject: [PATCH] Bug 9231 - Batch revert staged MARC records fails if one or more records in a batch have been deleted. > >If a record in an imported batch is dleted, any attempt to revert the >batch will result in the progress bar never reaching 100%. The >background job dies when it hits the already deleted record, with the >error occurring in C4::Items::DelItem for the line: > $copy2deleted->execute( $record->as_usmarc(), $itemnumber ); >which fails because $record is undefined. > >To keep the failure from causing the script to die, we just need >to eval it. Then, even if it fails, the batch revert will keep >going. > >Test Plan: >1) Stage a batch of marc records >2) Import those records >3) Delete one of those records >4) Attempt to revert the batch, it will hang. >5) Apply this patch >6) Repeat steps 1-4, the revert should succeed. >--- > C4/Items.pm | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index d9c31f9..bab538d 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -619,7 +619,7 @@ sub DelItem { > > # backup the record > my $copy2deleted = $dbh->prepare("UPDATE deleteditems SET marc=? WHERE itemnumber=?"); >- $copy2deleted->execute( $record->as_usmarc(), $itemnumber ); >+ eval { $copy2deleted->execute( $record->as_usmarc(), $itemnumber ); }; warn $@ if $@; > # This last update statement makes that the timestamp column in deleteditems is updated too. If you remove these lines, please add a line to update the timestamp separately. See Bugzilla report 7146 and Biblio.pm (DelBiblio). > > #search item field code >-- >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 9231
:
14186
|
17910
|
19348
|
19349
|
19350
|
20219