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 <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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" );