Bug 28845 - OpacAddMastheadLibraryPulldown does not respect multibranchlimit in OPAC_SEARCH_LIMIT
Summary: OpacAddMastheadLibraryPulldown does not respect multibranchlimit in OPAC_SEAR...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on:
Blocks: 28847
  Show dependency treegraph
 
Reported: 2021-08-11 15:30 UTC by Nick Clemens
Modified: 2022-06-06 20:27 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11


Attachments
Bug 28845: Match against the full limit string, not just the group id (2.09 KB, patch)
2021-08-11 15:31 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28845: Match against the full limit string, not just the group id (2.16 KB, patch)
2021-08-13 15:49 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 28845: (follow-up) Retain selection when using advanced search (1.58 KB, patch)
2021-09-07 12:00 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28845: Match against the full limit string, not just the group id (2.30 KB, patch)
2021-09-11 10:43 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 28845: (follow-up) Retain selection when using advanced search (1.72 KB, patch)
2021-09-11 10:43 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-08-11 15:30:29 UTC
If the OPAC_LIMIT_OVERRIDE and OPAC_SEARCH_LIMIT environment override values are set in apache and OpacAddMastheadLibraryPulldown is enabled, multibranchlimit values are not preselected as they should be:

To recreate
1 - Add to OPAC virtual host in apache conf:
   SetEnv OPAC_SEARCH_LIMIT branch:multibranch-1
   SetEnv OPAC_LIMIT_OVERRIDE 1
   RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-1"
   RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
2 - Enable system preference OpacAddMastheadLibraryPulldown
3 - Create a library group enabled as OPAC search group (or make sure existing group 1 is an OPAC search group)
4 - Load the opac - dropdown does not pree-select the search group
Comment 1 Nick Clemens 2021-08-11 15:31:53 UTC
Created attachment 123799 [details] [review]
Bug 28845: Match against the full limit string, not just the group id

To test:
1 - Add to OPAC virtual host in apache conf:
   SetEnv OPAC_SEARCH_LIMIT branch:multibranch-1
   SetEnv OPAC_LIMIT_OVERRIDE 1
   RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-1"
   RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
2 - Enable system preference OpacAddMastheadLibraryPulldown
3 - Create a library group enabled as OPAC search group (or make sure existing group 1 is an OPAC search group)
4 - Load the opac - dropdown does not pree-select the search group
5 - Apply patch
6 - Relaod opac - group is pre-selected!
Comment 2 Andrew Fuerste-Henry 2021-08-13 15:49:05 UTC
Created attachment 123828 [details] [review]
Bug 28845: Match against the full limit string, not just the group id

To test:
1 - Add to OPAC virtual host in apache conf:
   SetEnv OPAC_SEARCH_LIMIT branch:multibranch-1
   SetEnv OPAC_LIMIT_OVERRIDE 1
   RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-1"
   RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
2 - Enable system preference OpacAddMastheadLibraryPulldown
3 - Create a library group enabled as OPAC search group (or make sure existing group 1 is an OPAC search group)
4 - Load the opac - dropdown does not pree-select the search group
5 - Apply patch
6 - Relaod opac - group is pre-selected!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Joonas Kylmälä 2021-09-05 09:32:37 UTC
This patch breaks the group selection in OPAC advanced search, i.e. with this patch applied if you go to the URL

http://localhost:8080/cgi-bin/koha/opac-search.pl?advsearch=1&weight_search=1&multibranchlimit=1&sort_by=relevance&do=Search 

then the group doesn't get selected in the search menu.
Comment 4 Nick Clemens 2021-09-07 12:00:30 UTC
Created attachment 124573 [details] [review]
Bug 28845: (follow-up) Retain selection when using advanced search
Comment 5 Nick Clemens 2021-09-07 12:02:40 UTC
(In reply to Joonas Kylmälä from comment #3)
> This patch breaks the group selection in OPAC advanced search, i.e. with
> this patch applied if you go to the URL
> 
> http://localhost:8080/cgi-bin/koha/opac-search.
> pl?advsearch=1&weight_search=1&multibranchlimit=1&sort_by=relevance&do=Search
> 
> 
> then the group doesn't get selected in the search menu.

Updated, stole a change from 28847 :-)
Comment 6 Joonas Kylmälä 2021-09-11 10:43:23 UTC
Created attachment 124791 [details] [review]
Bug 28845: Match against the full limit string, not just the group id

To test:
1 - Add to OPAC virtual host in apache conf:
   SetEnv OPAC_SEARCH_LIMIT branch:multibranch-1
   SetEnv OPAC_LIMIT_OVERRIDE 1
   RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-1"
   RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
2 - Enable system preference OpacAddMastheadLibraryPulldown
3 - Create a library group enabled as OPAC search group (or make sure existing group 1 is an OPAC search group)
4 - Load the opac - dropdown does not pree-select the search group
5 - Apply patch
6 - Relaod opac - group is pre-selected!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 7 Joonas Kylmälä 2021-09-11 10:43:27 UTC
Created attachment 124792 [details] [review]
Bug 28845: (follow-up) Retain selection when using advanced search

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 8 Jonathan Druart 2021-09-20 12:47:52 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 9 Kyle M Hall 2021-10-01 17:32:25 UTC
Pushed to 21.05.x for 21.05.05
Comment 10 Fridolin Somers 2021-10-06 20:07:59 UTC
Pushed to 20.11.x for 20.11.11
Comment 11 Victor Grousset/tuxayo 2021-10-16 00:17:56 UTC
Can't backport to 20.05.x due to a conflict.
The relevant code isn't there ([% IF lsg.id == opac_name %])

Help needed if someone is interested in the backport.

I couldn't reproduce but I'm not sure if I did it right or if 20.05.x isn't affected. On request I can try with 20.11.x to check if did the test plan correctly.