Previously one could scope an OPAC to a specific library group using lines as below in the apache configuration: SetEnv OPAC_SEARCH_LIMIT branch:HCC_GROUP SetEnv OPAC_LIMIT_OVERRIDE 1 RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:HCC_GROUP" RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1" This does not work with the new groups system as the groups do not have codes
Created attachment 82743 [details] [review] Bug 21911: Fix OPAC scoping to work with new group system To test: 0 - Apply patch 1 - Create a library group enabled for opac search limits and add some libraries 2 - Check the DB (or advanced search dropdown) to get the id of the group (using 7 as example below) 3 - Add to apache configuration (OPAC virtualhost) SetEnv OPAC_SEARCH_LIMIT branch:multibranchlimit-7 SetEnv OPAC_LIMIT_OVERRIDE 1 RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-7" RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1" 4 - Ensure OpacAddMastheadLibraryPulldown is disabled 5 - Restart all the things 6 - Visit the opac 7 - Perform a search, confirm it is scoped to the branches in the group
Created attachment 82754 [details] [review] Bug 21911: Fix OPAC scoping to work with new group system To test: 0 - Apply patch 1 - Create a library group enabled for opac search limits and add some libraries 2 - Check the DB (or advanced search dropdown) to get the id of the group (using 7 as example below) 3 - Add to apache configuration (OPAC virtualhost) SetEnv OPAC_SEARCH_LIMIT branch:multibranchlimit-7 SetEnv OPAC_LIMIT_OVERRIDE 1 RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-7" RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1" 4 - Ensure OpacAddMastheadLibraryPulldown is disabled 5 - Restart all the things 6 - Visit the opac 7 - Perform a search, confirm it is scoped to the branches in the group Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works as expected, Signing off.. With my QA hat on, it would be lovely to have a regression test for this.
Created attachment 82767 [details] [review] Bug 21911: Regression test This tests usuall cases, but note, that administrator could make a branch with code "%%%" or so, which this test does not cover, and some functionalities will not work in that case: opac limit override, holdinbranch facet
The problem is a bit wider a think: It is possible ta create a library with code "%%%" for example - it is weird, but you can do it. Then this will not work again... even facets does not work with these kind of library codes....
Created attachment 82949 [details] [review] Bug 21911: Fix OPAC scoping to work with new group system To test: 0 - Apply patch 1 - Create a library group enabled for opac search limits and add some libraries 2 - Check the DB (or advanced search dropdown) to get the id of the group (using 7 as example below) 3 - Add to apache configuration (OPAC virtualhost) SetEnv OPAC_SEARCH_LIMIT branch:multibranchlimit-7 SetEnv OPAC_LIMIT_OVERRIDE 1 RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-7" RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1" 4 - Ensure OpacAddMastheadLibraryPulldown is disabled 5 - Restart all the things 6 - Visit the opac 7 - Perform a search, confirm it is scoped to the branches in the group Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 82950 [details] [review] Bug 21911: Regression test This tests usuall cases, but note, that administrator could make a branch with code "%%%" or so, which this test does not cover, and some functionalities will not work in that case: opac limit override, holdinbranch facet Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.01
Pushed to 18.05.x for 18.05.07
Depends on Bug 21910 not in 17.11.x
*** Bug 17683 has been marked as a duplicate of this bug. ***