From fc96399c95153e4b305c9239e3211c9e829d67a6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 23 Jun 2021 16:19:15 +0200 Subject: [PATCH] Bug 28622: (bug 15758 follow-up) Remove incorrect branch selection in adv search From commit df97814f3034a3d5015546c4eca21f08ae951e37 Bug 15758: Koha::Libraries - Remove GetBranches + selected_branchcode => ( C4::Context->IsSuperLibrarian ? C4::Context->userenv : '' ), And - [% PROCESS options_for_libraries libraries => Branches.all() %] + [%# FIXME Should not we filter the libraries displayed? %] + [% PROCESS options_for_libraries libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %] The change in the pl is wrong as it should pass C4::Context->userenv->{branch}, but prior to this commit it seems that we didn't select the logged in library anyway. Looks like we should remove this code but preserve the current behavior and select "All libraries". Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- catalogue/search.pl | 1 - koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 632d9d2e99..8ed6ff3181 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -235,7 +235,6 @@ my @search_groups = @search_groups = sort { $a->title cmp $b->title } @search_groups; $template->param( - selected_branchcode => ( C4::Context->IsSuperLibrarian ? C4::Context->userenv : '' ), search_groups => \@search_groups, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt index 6660d2ca8f..a4d7c6d9d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -287,7 +287,7 @@

[% IF search_groups %] -- 2.39.5