@@ -, +, @@ selected in filters - Make sure there are issues on records created in the past 3 month - Go to OPAC not logged-in - Click on "Most popular" - Select a branch and submit - Select a branch and perform a search that does not have results (for example an item type never issued) - Log-in with a user - Click on "Most popular" - Select "All libraries" and submit - Select "All libraries" and perform a search that does not have results (for example an item type never issued) --- .../opac-tmpl/prog/en/includes/opac-topissues.inc | 4 ++-- .../opac-tmpl/prog/en/modules/opac-topissues.tt | 2 +- opac/opac-topissues.pl | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc +++ a/koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc @@ -15,9 +15,9 @@
  • - + [% FOREACH branchloo IN branchloop %] [% IF ( branchloo.selected ) %] --- a/opac/opac-topissues.pl +++ a/opac/opac-topissues.pl @@ -62,7 +62,8 @@ my $dbh = C4::Context->dbh; my $limit = $input->param('limit'); $limit = 10 unless ($limit && $limit =~ /^\d+$/); # control user input for SQL query $limit = 100 if $limit > 100; -my $branch = $input->param('branch') || ''; +my $branch_input = $input->param('branch') || ''; +my $branch = $branch_input eq '__ANY__' ? '' : $branch_input ; # __ANY__ is used to distinguish form display and no branch filter selected my $itemtype = $input->param('itemtype') || ''; my $timeLimit = $input->param('timeLimit') || 3; my $advanced_search_types = C4::Context->preference('AdvancedSearchTypes'); @@ -138,7 +139,9 @@ $template->param(do_it => 1, results_loop => \@results, ); -$template->param( branchloop => GetBranchesLoop(C4::Context->userenv?C4::Context->userenv->{'branch'}:'')); +# GetBranchesLoop without parameter will select user default branch +my $branchloop = $branch_input ? GetBranchesLoop($branch_input) : GetBranchesLoop(); +$template->param( branchloop => $branchloop ); # the index parameter is different for item-level itemtypes my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; --