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>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2018-06-04 13:52:28 +00:00 committed by Nick Clemens
parent 6965c58308
commit ce6ec1e7fa

View file

@ -22,7 +22,9 @@
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") %]
<!-- koha core js -->
[% Asset.js("js/staff-global.js") %]
[% Asset.js("js/commons.js") %]
[% IF Koha.Preference('BrowseResultSelection') %]
[% Asset.js("js/commons.js") %]
[% END %]
[% INCLUDE 'validator-strings.inc' %]
[% IF ( IntranetUserJS ) %]