Browse Source

Bug 29019: Restore eval call

But fix it (pass an arrayref). We need the eval to catch possible errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11.x
Jonathan Druart 3 years ago
parent
commit
d8ff6293e8
  1. 2
      tools/additional-contents.pl

2
tools/additional-contents.pl

@ -174,7 +174,7 @@ elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'delete_confirmed' ) {
my @ids = $cgi->multi_param('ids');
my $deleted =
map { Koha::AdditionalContents->find($_)->delete() } @ids;
eval { Koha::AdditionalContents->search( { idnew => \@ids } )->delete; };
if ( $@ or not $deleted ) {
push @messages, { type => 'error', code => 'error_on_delete' };

Loading…
Cancel
Save