Bug 24733: created_by param should be an arrayref
authorNick Clemens <nick@bywatersolutions.com>
Wed, 26 Feb 2020 03:16:26 +0000 (03:16 +0000)
committerHayley Mapley <hayleymapley@catalyst.net.nz>
Tue, 14 Apr 2020 04:19:14 +0000 (16:19 +1200)
We allow for the user to add multiple users to this field, and the
search function expects and array. We have been treating it as a scalar

TO test:
1 - Have an open basket in acquisitions
2 - Add to basket - from an existing order (copy)
3 - Enter a name in the 'Basket created by' field and select a user
4 - Hit search
5 - ISE (Can't use string ("1") as an ARRAY ref while "strict refs" in use at /usr/share/koha/lib/C4/Acquisition.pm line 2482.)
6 - Apply patch
7 - Repeat 1-4
8 - Success!
9 - Test with mutiple 'created by' entries as well

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 789866e585be0a5c439559383325cbe4db525412)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 63374a8db6f759c8bb3e9b6ca1029ad07d2bb938)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

acqui/duplicate_orders.pl

index 549c8b4..c3b86b8 100755 (executable)
@@ -65,8 +65,9 @@ my $filters = {
     orderstatus             => scalar $input->param('orderstatus'),
     ordernumber             => scalar $input->param('ordernumber'),
     search_children_too     => scalar $input->param('search_children_too'),
-    created_by              => scalar $input->multi_param('created_by'),
+    created_by              => [$input->multi_param('created_by')]
 };
+
 my $from_placed_on =
   eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string;
 my $to_placed_on =