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.
I confirm, will try to patch
Ohhh there is the arg "do_not_select_my_library => 1"
Created attachment 188467 [details] [review] Bug 40903: OPAC advanced search should not apply 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. 1) Go to OPAC 2) Authenticate with a user 3) Go to advanced search 4) Check there is no library selected in 'Location and availability' 5) Select a library and submit 6) Clik on 'Return to the last advanced search' 7) Check the library is selected in 'Location and availability'
I'm a bit confused... This behaviour does not seem related to bug 36742. Rather, it's been a standard part of Koha for a very long time? Like the code has been part of Koha/Template/Plugin/Branches.pm for about 10 years and before that I think it was in C4/Branches.pm?
A library was upgraded from 22.11 to 24.11 so they complained about this change. I'v checked 22.11 and 23.11, I see there is no default library limit.
Ahhh the code before 24.11 was calling : [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %] 'opac_name' comming from C4::Auth and depending on system preference 'SearchMyLibraryFirst'. So we must use the same 'selected' I bet. And add system preference 'SearchMyLibraryFirst' to the test plan.
Created attachment 188501 [details] [review] 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'
Created attachment 188527 [details] [review] 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>
(In reply to Fridolin Somers from comment #6) > Ahhh the code before 24.11 was calling : > [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %] > 'opac_name' comming from C4::Auth and depending on system preference > 'SearchMyLibraryFirst'. > > So we must use the same 'selected' I bet. > And add system preference 'SearchMyLibraryFirst' to the test plan. Ahh interesting. The older libraries I checked appear to be using SearchMyLibraryFirst, which is why it seemed like older versions worked the same way. Nice one, Frido!
(In reply to David Cook from comment #4) > I'm a bit confused... > > This behaviour does not seem related to bug 36742. > For what it's worth, I had done a git cherry-pick which narrowed this behaviour down to the patch from Bug 36742!
(In reply to Aleisha Amohia from comment #10) > (In reply to David Cook from comment #4) > > I'm a bit confused... > > > > This behaviour does not seem related to bug 36742. > > > > For what it's worth, I had done a git cherry-pick which narrowed this > behaviour down to the patch from Bug 36742! My bad! I think I must've misread bug 36742 as well, as I think it ends up doing the thing is says it doesn't want to do in the description. Oh well... I'll have a crack at QAing this shortly.
Created attachment 188536 [details] [review] 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>
Nice work everyone! Pushed to main for 25.11