Bug 20864 - Only set bibs_selected cookie when BrowseResultSelection is activated
Summary: Only set bibs_selected cookie when BrowseResultSelection is activated
Status: REOPENED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 19290
Blocks: 21024
  Show dependency treegraph
 
Reported: 2018-06-03 09:45 UTC by Katrin Fischer
Modified: 2018-07-12 07:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated (1.90 KB, patch)
2018-06-04 14:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated (1.96 KB, patch)
2018-06-19 21:13 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated (2.04 KB, patch)
2018-06-22 13:55 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-06-03 09:45:35 UTC
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.
Comment 1 Owen Leonard 2018-06-04 14:18:31 UTC
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.
Comment 2 Katrin Fischer 2018-06-19 21:13:46 UTC
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>
Comment 3 Jonathan Druart 2018-06-22 13:53:38 UTC
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.
Comment 4 Jonathan Druart 2018-06-22 13:55:59 UTC
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>
Comment 5 Nick Clemens 2018-06-22 22:04:23 UTC
Awesome work all!

Pushed to master for 18.11.x
Comment 6 Martin Renvoize 2018-06-27 10:38:32 UTC
Pushed to 18.05.x for 18.05.02
Comment 7 Fridolin SOMERS 2018-06-28 08:52:09 UTC
Depends on Bug 19290 not in 17.11.x
Comment 8 Jonathan Druart 2018-06-29 17:29:27 UTC
Bad one, there is a JS error on the search result, which breaks all JS functionalities (add to basket, list, etc.)
Comment 9 Jonathan Druart 2018-06-29 17:57:05 UTC
(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.
Comment 10 Martin Renvoize 2018-07-12 07:04:59 UTC
Reverted in 18.05.x series.