Bug 42202: Unfilter branches for OPAC search, news, and most popular

This change unfilters the branches for OPAC search, news, and most popular.
This is most noticeable when using the IndependentBranches system preference.
This change aligns the UX for both logged in and not logged in users

__SETUP__
- Do not apply the patch yet
- Log into Koha
- Go to Administration > System preferences
- Search for OpacAddMastheadLibraryPulldown system preference
- Change it to "Add" and save the preference
- Search for IndependentBranches system preference
- Set it to "Yes" and save the preference
- Search for OpacTopissue system preference
- Set it to "Allow" and save the preference
- Search for OpacNewsLibrarySelect system preference
- Set it to "Show" and save the preference
- Go to Patrons
- Create or modify a patron with a username/password but no superlibrarian
permission

__TESTS__
- Go to the OPAC (and logout if you're already logged in)
- Note that the library pull down saying "All libraries" is present
in the masthead
- Log in as your unprivileged user
- Note that the library pull down saying "All libraries" is now hidden
- Go to Advanced search and note there's no "Location and availability" option
- Go to "Most popular" and note there's no "From:" library filter
- Go to the home page and note it does not show a library selector for news

- Apply the patch

- Refresh the page
- Note that the library pull down saying "All libraries" is present
in the masthead
- Note that the "From:" library filter now appears
- Go to Advanced search and note "Location and availability" now appears
- Go to the home page and note it now shows a library selector for news

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 15a30e13d0)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
David Cook 2026-03-30 01:31:33 +00:00 committed by Baptiste Wojtkowski
parent caccdbb36e
commit c1c3e8c605
No known key found for this signature in database
GPG Key ID: 47A8A13E10BC0D40
4 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@
[% SET OpacMoreSearches = AdditionalContents.get( location => "OpacMoreSearches", lang => lang, library => branchcode || default_branch ) %]
[% SET CookieConsentBar = AdditionalContents.get( location => "CookieConsentBar", lang => lang, library => branchcode || default_branch ) %]
[% SET CookieConsentPopup = AdditionalContents.get( location => "CookieConsentPopup", lang => lang, library => branchcode || default_branch ) %]
[% SET AllPublicBranches = Branches.all( search_params => { public => 1 }, selected => opac_name ) %]
[% SET AllPublicBranches = Branches.all( search_params => { public => 1 }, selected => opac_name, unfiltered => 1 ) %]
<button id="scrolltocontent">Skip to main content</button>
<!-- prettier-ignore-start -->

View File

@ -1,7 +1,7 @@
[% USE Koha %]
[% USE Branches %]
[% PROCESS 'html_helpers.inc' %]
[% SET AllPublicBranches = Branches.all( search_params => { public => 1 }, selected => branch ) %]
[% SET AllPublicBranches = Branches.all( search_params => { public => 1 }, selected => branch, unfiltered => 1 ) %]
<div id="search-facets">
<form method="get" action="/cgi-bin/koha/opac-topissues.pl">

View File

@ -32,7 +32,7 @@
</head>
[% INCLUDE 'bodytag.inc' bodyid='advsearch' bodyclass='scrollto' %]
[% INCLUDE 'masthead.inc' %]
[% SET AllPublicBranches = Branches.all( selected => opac_name, search_params => { public => 1 } ) %]
[% SET AllPublicBranches = Branches.all( selected => opac_name, search_params => { public => 1 }, unfiltered => 1 ) %]
<form id="advsearch_form" action="/cgi-bin/koha/opac-search.pl" method="get">
<input type="hidden" name="advsearch" value="1" />

View File

@ -13,7 +13,7 @@
[% SET OpacNavRight = AdditionalContents.get( location => "OpacNavRight", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
[% SET OpacMainUserBlock = AdditionalContents.get( location => "OpacMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
[% SET AllPublicBranches = Branches.all( search_params => { public => 1 }, selected => branchcode ) %]
[% SET AllPublicBranches = Branches.all( search_params => { public => 1 }, selected => branchcode, unfiltered => 1 ) %]
[% INCLUDE 'doc-head-open.inc' %]
<title
>[% FILTER collapse %]