The bibs_selected cookie stores the biblionumbers of entries selected in a search result list. At the moment the cookies appears to always be set, even if BrowseResultSelection is set to disabled.
Created attachment 75771 [details] [review] Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated This patch adds a system preference check around the call to the JavaScript include which sets the bibs_selected cookie. With BrowseResultsSelection disabled, the cookie should never be set. To test you should be using a browser with a tool for inspecting cookies. View the cookies for your Koha domain under each of these conditions, clearing cookies between each step: Without the patch applied: - With BrowseResultSelection enabled, search for any item. Your cookie tool should report that you have a bibs_selected cookie stored. - With BrowseResultSelection disabled, search for any item. You should have a bibs_selected cookie. With the patch applied: - With the BrowseResultSelection system preference enabled, search for any item. Your cookie tool should report that you have a bibs_selected cookie stored. - With BrowseResultSelection disabled, search for any item. You should have no bibs_selected cookie.
Created attachment 76196 [details] [review] Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated This patch adds a system preference check around the call to the JavaScript include which sets the bibs_selected cookie. With BrowseResultsSelection disabled, the cookie should never be set. To test you should be using a browser with a tool for inspecting cookies. View the cookies for your Koha domain under each of these conditions, clearing cookies between each step: Without the patch applied: - With BrowseResultSelection enabled, search for any item. Your cookie tool should report that you have a bibs_selected cookie stored. - With BrowseResultSelection disabled, search for any item. You should have a bibs_selected cookie. With the patch applied: - With the BrowseResultSelection system preference enabled, search for any item. Your cookie tool should report that you have a bibs_selected cookie stored. - With BrowseResultSelection disabled, search for any item. You should have no bibs_selected cookie. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Hum yes, "commons.js" was certainly not the best name. Maybe the test must be moved to common.js, but not blocker for this quick fix.
Created attachment 76289 [details] [review] Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated This patch adds a system preference check around the call to the JavaScript include which sets the bibs_selected cookie. With BrowseResultsSelection disabled, the cookie should never be set. To test you should be using a browser with a tool for inspecting cookies. View the cookies for your Koha domain under each of these conditions, clearing cookies between each step: Without the patch applied: - With BrowseResultSelection enabled, search for any item. Your cookie tool should report that you have a bibs_selected cookie stored. - With BrowseResultSelection disabled, search for any item. You should have a bibs_selected cookie. With the patch applied: - With the BrowseResultSelection system preference enabled, search for any item. Your cookie tool should report that you have a bibs_selected cookie stored. - With BrowseResultSelection disabled, search for any item. You should have no bibs_selected cookie. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Awesome work all! Pushed to master for 18.11.x
Pushed to 18.05.x for 18.05.02
Depends on Bug 19290 not in 17.11.x
Bad one, there is a JS error on the search result, which breaks all JS functionalities (add to basket, list, etc.)
(In reply to Jonathan Druart from comment #8) > Bad one, there is a JS error on the search result, which breaks all JS > functionalities (add to basket, list, etc.) See bug 20864.
Reverted in 18.05.x series.
Anyone have an opinion on whether I should work on backporting this?