From f94150f31865096630106fa338a6be23c5ef1927 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. --- 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 288c6e1ab70..bddbb844b96 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.25.1