Bug 22688: (QA follow-up) Use search_params as all() does
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 11 Apr 2019 20:15:51 +0000 (17:15 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 25 Apr 2019 13:30:47 +0000 (14:30 +0100)
It looks like selected would be passed all the way down to
Koha::Libraries->search and this would fail all the time.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a48d1a43df24a47f1d31cd437a54961934d50230)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha/Template/Plugin/Branches.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt

index df11ab8..da615f5 100644 (file)
@@ -88,8 +88,10 @@ sub InIndependentBranchesMode {
 sub pickup_locations {
     my ( $self, $params ) = @_;
 
-    my $selected  = $params->{selected};
-    my $libraries = Koha::Libraries->pickup_locations($params);
+    my $search_params = $params->{search_params} || {};
+    my $selected      = $params->{selected};
+    my $libraries     = Koha::Libraries->pickup_locations($search_params);
+
     for my $l (@$libraries) {
         if ( defined $selected and $l->{branchcode} eq $selected
             or not defined $selected
index d643c80..b26fbaf 100644 (file)
                                                                 <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
                                                                 [% UNLESS ( bibitemloo.holdable ) %]
                                                                     <select name="branch" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
-                                                                        [% PROCESS options_for_libraries libraries => Branches.pickup_locations( biblio => bibitemloo.biblionumber, selected => branch ) %]
+                                                                        [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => bibitemloo.biblionumber }, selected => branch }) %]
                                                                     </select>
                                                                 [% ELSE %]
                                                                     [% SET at_least_one_library_not_available_for_pickup = 0 %]