Bugzilla – Attachment 10155 Details for
Bug 7329
The "undo import into catalog" command deletes items onloan without checking
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 7329: Items onloan are deleted when undoing import into catalog
SIGNED-OFF-Bug-7329-Items-onloan-are-deleted-when-.patch (text/plain), 1.75 KB, created by
Katrin Fischer
on 2012-06-11 08:58:12 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 7329: Items onloan are deleted when undoing import into catalog
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2012-06-11 08:58:12 UTC
Size:
1.75 KB
patch
obsolete
>From d62ee9b7e5f09f310cf795317a7b220f867dbf87 Mon Sep 17 00:00:00 2001 >From: Christophe Croullebois <christophe.croullebois@biblibre.com> >Date: Wed, 7 Dec 2011 11:54:29 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 7329: Items onloan are deleted when undoing > import into catalog > >this patch checks the "on loan" and "reserved" status before deleting item, and >do noting in this case, so the record can't be deleted due to existing item. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/ImportBatch.pm | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 8d4a488..5dbf839 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -715,13 +715,18 @@ sub BatchRevertItems { > $sth->bind_param(1, $import_record_id); > $sth->execute(); > while (my $row = $sth->fetchrow_hashref()) { >- DelItem($dbh, $biblionumber, $row->{'itemnumber'}); >- my $updsth = $dbh->prepare("UPDATE import_items SET status = ? WHERE import_items_id = ?"); >- $updsth->bind_param(1, 'reverted'); >- $updsth->bind_param(2, $row->{'import_items_id'}); >- $updsth->execute(); >- $updsth->finish(); >- $num_items_deleted++; >+ my $error = DelItemCheck($dbh, $biblionumber, $row->{'itemnumber'}); >+ if ($error == 1){ >+ my $updsth = $dbh->prepare("UPDATE import_items SET status = ? WHERE import_items_id = ?"); >+ $updsth->bind_param(1, 'reverted'); >+ $updsth->bind_param(2, $row->{'import_items_id'}); >+ $updsth->execute(); >+ $updsth->finish(); >+ $num_items_deleted++; >+ } >+ else { >+ next; >+ } > } > $sth->finish(); > return $num_items_deleted; >-- >1.7.9.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 7329
:
6635
|
6829
|
10070
|
10125
| 10155 |
10156
|
10157