From dd3b509d551e9d2f1c1154cb3cc9ff5344213905 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' Signed-off-by: Jonathan Druart --- 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.39.5