Bug 24051: Remove "search( %condition ) is deprecated" warning from batchMod.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 18 Nov 2019 10:29:46 +0000 (11:29 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 19 Feb 2020 11:29:25 +0000 (11:29 +0000)
Test plan:
Go to Home › Tools › Batch item modification
Insert barcodes and continue
=> Without this patch you will get warning in the log
=> With this patch applied you warning does no longer appear
Confirm that the number of holds is correct

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

tools/batchMod.pl

index 3da1efb..f9fb0a5 100755 (executable)
@@ -632,7 +632,7 @@ sub BuildItemsData{
             $this_row{isbn}         = $biblio->biblioitem->isbn;
             $this_row{biblionumber} = $biblio->biblionumber;
             $this_row{holds}        = $biblio->holds->count;
-            $this_row{item_holds}   = Koha::Holds->search( itemnumber => $itemnumber )->count;
+            $this_row{item_holds}   = Koha::Holds->search( { itemnumber => $itemnumber } )->count;
 
                        if (%this_row) {
                                push(@big_array, \%this_row);