Bugzilla – Attachment 113417 Details for
Bug 26992
On serial collection page, impossible to delete issues and related items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26992 - On serial collection page, impossible to delete issues and related items
Bug-26992---On-serial-collection-page-impossible-t.patch (text/plain), 2.01 KB, created by
Frédéric Demians
on 2020-11-10 16:03:35 UTC
(
hide
)
Description:
Bug 26992 - On serial collection page, impossible to delete issues and related items
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2020-11-10 16:03:35 UTC
Size:
2.01 KB
patch
obsolete
>From 722ce6441fb8710162bee872fb87ea31520aa323 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Tue, 10 Nov 2020 17:00:09 +0100 >Subject: [PATCH] Bug 26992 - On serial collection page, impossible to delete > issues and related items > >serial-collection.pl uses C4::Items::DelItemCheck() function which is obsolte. > >Test plan: > >1. Create a subscription with items created when receiving. >2. Receive several issues, and create corresponding items. >3. On Serial collection page (serial-collection.pl), select several issues. >4. Click on button Delete selected issues >5. A confirmation page is displayed. Enable "Delete associated items?". > Then click on "Yes, delete" button. > > You get this error: Undefined subroutine &C4::Items::DelItemCheck > >6. Apply the patch an repeat steps 3-5. > Check that issues and related items are deleted. >--- > serials/serials-collection.pl | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl >index a1979eda63..f47155b6be 100755 >--- a/serials/serials-collection.pl >+++ b/serials/serials-collection.pl >@@ -121,9 +121,13 @@ if($op eq 'delete_confirm'){ > if($query->param('delitems') eq "Yes"){ > foreach my $serialid (@serialsid){ > my @itemnumbers = Koha::Serial::Items->search({serialid => $serialid})->get_column('itemnumber'); >- foreach my $itemnumber (@itemnumbers){ >- my $delcheck = C4::Items::DelItemCheck($biblionumber, $itemnumber); >- $template->param(error_delitem => 1) if $delcheck != 1; >+ for my $itemnumber (@itemnumbers) { >+ my $items = Koha::Items->search({ itemnumber => $itemnumber }); >+ while ( my $item = $items->next ) { >+ my $deleted_item = eval { $item->safe_delete }; >+ $template->param(error_delitem => 1) >+ if !ref($deleted_item) or $@; >+ } > } > } > } >-- >2.17.1
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 26992
:
113417
|
113582
|
113599
|
113661
|
113681
|
113694
|
113703
|
113753
|
113815