Bug 40903: Fix OPAC advanced search applies a limit of the logged-in library by default

This is caused by Bug 36742. It exists in main but starts in 24.11.

The OPAC advanced search now automatically applies a limit to the 'Location and availability' section using the patron's logged in library, even if there are multiple libraries in the system.
This feature must be depending on system preference 'SearchMyLibraryFirst'.

1) Set system preference 'SearchMyLibraryFirst' to 'Don't limit'
2) Go to OPAC
3) Authenticate with a user
4) Go to advanced search
5) Check there is no library selected in 'Location and availability'
6) Select a library and submit
7) Clik on 'Return to the last advanced search'
8) Check the library is selected in 'Location and availability'
9) Set system preference 'SearchMyLibraryFirst' to 'Limit'
10) Go to OPAC
11) Authenticate with a user
12) Go to advanced search
13) Check library of patron selected in 'Location and availability'

Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d14619158e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Fridolin Somers 2025-10-27 11:56:58 +01:00 committed by Paul Derscheid
parent f59d8c46e3
commit e4026f08a1
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 1 additions and 1 deletions

View File

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