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>
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
<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 %]