Bug 28718: handle multiple deletions from news
authorLucas Gass <lucas@bywatersolutions.com>
Fri, 16 Jul 2021 14:44:10 +0000 (14:44 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 26 Jul 2021 08:39:26 +0000 (10:39 +0200)
To test:
1. have multiple news
2. check several of them and and click 'Delete selected'
3. see ugly error
4. apply patch
5. try again
6. no error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
tools/koha-news.pl

index cfc8066..ef615a4 100755 (executable)
@@ -138,7 +138,7 @@ elsif ( $op eq 'edit' ) {
 }
 elsif ( $op eq 'del' ) {
     my @ids = $cgi->multi_param('ids');
-    Koha::News->search({ idnew => @ids })->delete;
+    Koha::News->search({ idnew => \@ids })->delete;
     print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
 }