From c748a445c0b237932c0a220a9c7f70fa17151962 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 22 Apr 2020 13:30:06 +0000 Subject: [PATCH] Bug 25248: (bug 23463 follow-up) Item is returned if deletion successful, not 1 To test: 1 - Have a record with some items 2 - Click 'Delete all' under 'Edit' 3 - Confirm deletion 4 - Note you are redirected to additem.pl 5 - Add an item 6 - Apply patch 7 - Delete all items again 8 - Note you are redirected to detail.pl Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- cataloguing/additem.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 1a7e9385eb..8025241b6f 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -687,7 +687,7 @@ if ($op eq "additem") { my $items = Koha::Items->search({ biblionumber => $biblionumber }); while ( my $item = $items->next ) { $error = $item->safe_delete({ skip_modzebra_update => 1 }); - next if $error eq '1'; # Means ok + next if ref $error eq 'Koha::Item'; # Deleted item is returned if deletion successful push @errors,$error; } C4::Biblio::ModZebra( $biblionumber, "specialUpdate", "biblioserver" ); -- 2.39.5