From e29c5f3511bc116de3c7a3f7be869c5aefe4ca97 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Apr 2015 12:52:36 +0200 Subject: [PATCH] [SIGNED-OFF] Bug 12320: Remove deprecated construct to delete cookie showColumns $.cookie('foo', null); is deprecated and should be replaced with $.removeCookie('foo'); This patch replaces the occurrences for the "showColumns" cookie. Before this patch, there was a bug on the batchmod tools. To reproduce the issue: 1/ Go on the Batch item modification tool 2/ Fill the textarea with barcodes and submit 3/ Click on some column names (to create the cookie) 4/ Click on 'Show all columns" (to set the cookie to null) 5/ Don't submit and repeat steps 1 & 2 6/ You should see a js error: Error: Syntax error, unrecognized expression: :nth-child ...break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecogni... Test plan: Confirm the issue has gone away and there is no regression on the column selection Signed-off-by: Bernardo Gonzalez Kriegel No js error, no regressions, no errors --- .../intranet-tmpl/prog/en/js/pages/batchMod.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js index 19abef3..133194a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js @@ -40,10 +40,10 @@ function hideColumn(num) { if( !found ){ valCookie.push(hide); var cookieString = valCookie.join("/"); - $.cookie("showColumns", cookieString, { expires : date }); + $.cookie("showColumns", cookieString, { expires : date, path: '/' }); } } else { - $.cookie("showColumns", hide, { expires : date }); + $.cookie("showColumns", hide, { expires : date, path: '/' }); } } @@ -75,7 +75,7 @@ function showColumn(num){ } if( found ){ var cookieString = valCookie.join("/"); - $.cookie("showColumns", cookieString, { expires : date }); + $.cookie("showColumns", cookieString, { expires : date, path: '/' }); } } } @@ -83,7 +83,7 @@ function showAllColumns(){ $("#selections").checkCheckboxes(); $("#selections span").addClass("selected"); $("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show(); - $.cookie("showColumns",null); + $.removeCookie("showColumns", { path: '/' }); $("#hideall").removeAttr("checked").parent().removeClass("selected"); } function hideAllColumns(){ @@ -92,7 +92,7 @@ function hideAllColumns(){ $("#itemst td:nth-child(2),#itemst th:nth-child(2)").nextAll().hide(); $("#hideall").attr("checked","checked").parent().addClass("selected"); var cookieString = allColumns.join("/"); - $.cookie("showColumns", cookieString, { expires : date }); + $.cookie("showColumns", cookieString, { expires : date, path: '/' }); } $(document).ready(function() { -- 1.7.9.5