From 38cb92fd7b101aef747c48d7847b500e7397703c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 21 Apr 2021 16:57:08 +0200 Subject: [PATCH] Bug 23271: Fix Template/Plugin/Branches.t # Failed test 'Without selected parameter, my library should be preselected' # at t/db_dependent/Template/Plugin/Branches.t line 81. # got: '0' # expected: '1' --- Koha/Template/Plugin/Branches.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index 58b84d18e0..92c83be68c 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/Koha/Template/Plugin/Branches.pm @@ -58,7 +58,7 @@ sub GetURL { sub all { my ( $self, $params ) = @_; - my $selected = $params->{selected} || (); + my $selected = $params->{selected} // (); my $unfiltered = $params->{unfiltered} || 0; my $search_params = $params->{search_params} || {}; my $do_not_select_my_library = $params->{do_not_select_my_library} || 0; # By default we select the library of the logged in user if no selected passed @@ -70,7 +70,7 @@ sub all { my @selected = ref $selected eq 'Koha::Libraries' ? $selected->get_column('branchcode') - : $selected; + : ( $selected // () ); my $libraries = $unfiltered ? Koha::Libraries->search( $search_params, { order_by => ['branchname'] } )->unblessed -- 2.20.1