From bf0653163515bc83790299ccd3a5ad7a89a23e07 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 4 Jun 2018 13:52:28 +0000 Subject: [PATCH] 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 --- koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index de81f3f..946859a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -22,7 +22,9 @@ [% Asset.js("lib/jquery/plugins/jquery.validate.min.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 ) %] -- 2.1.4