From d8ff6293e859a8f19580c9cf6f7e73e73a70e4c8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Sep 2021 12:43:07 +0200 Subject: [PATCH] Bug 29019: Restore eval call But fix it (pass an arrayref). We need the eval to catch possible errors. Signed-off-by: Jonathan Druart --- tools/additional-contents.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/additional-contents.pl b/tools/additional-contents.pl index 288c6e1ab7..bddbb844b9 100755 --- a/tools/additional-contents.pl +++ b/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' }; -- 2.39.2