Bugzilla – Attachment 39284 Details for
Bug 13265
Still too many search cursor cookies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13265 - Still too many search cursor cookies
Bug-13265---Still-too-many-search-cursor-cookies.patch (text/plain), 12.07 KB, created by
Marcel de Rooy
on 2015-05-18 13:14:29 UTC
(
hide
)
Description:
Bug 13265 - Still too many search cursor cookies
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-05-18 13:14:29 UTC
Size:
12.07 KB
patch
obsolete
>From 4d2691e0f9fa37041c22e1b28ae77add6e60f149 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 17 Nov 2014 09:39:24 -0500 >Subject: [PATCH] Bug 13265 - Still too many search cursor cookies >Content-Type: text/plain; charset=utf-8 > >We have multiple sites that are still exhibiting bug 11369. For whatever >reason, the cookies on these sites are larger and thus the maximum of 10 >is still too large. This setting should be controlled by a system >preference to the number can be tailored on a per-site basis. > >Test Plan: >1) Apply this patch >2) Run updatedatabase.pl >3) Set the new system preference MaxSearchCookies to a high number ( e.g. 20 ). >4) Perform searches until you get the error described in bug 11369 >5) Delete your cookies so you can use the staff intranet again >5) Set the system preference to a much lower number ( e.g. 5 ) >6) Repeat setp 4, you should no longer get the error. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Works, but does not remove all superfluous cookies. The code still >removes only the oldest one. >--- > installer/data/mysql/atomicupdate/bug_13265.sql | 1 + > installer/data/mysql/sysprefs.sql | 1 + > koha-tmpl/intranet-tmpl/js/browser.js | 6 ++++-- > .../prog/en/modules/admin/preferences/cataloguing.pref | 5 +++++ > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt | 3 ++- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt | 3 ++- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- > .../intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt | 3 ++- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt | 3 ++- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 3 ++- > 12 files changed, 24 insertions(+), 10 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_13265.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_13265.sql b/installer/data/mysql/atomicupdate/bug_13265.sql >new file mode 100644 >index 0000000..b6bde5a >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_13265.sql >@@ -0,0 +1 @@ >+INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('MaxSearchCookies','10',NULL,'Defines the maximum number of search cookies to store in the browser.','Integer'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index f371193..f0bdf9a 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -205,6 +205,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'), > ('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer'), > ('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'), >+('MaxSearchCookies','10',NULL,'Defines the maximum number of search cookies to store in the browser.','Integer') > ('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'), > ('maxRecordsForFacets','20',NULL,NULL,'Integer'), > ('maxreserves','50','','Define maximum number of holds a patron can place','Integer'), >diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js >index 824e409..f5624c6 100644 >--- a/koha-tmpl/intranet-tmpl/js/browser.js >+++ b/koha-tmpl/intranet-tmpl/js/browser.js >@@ -1,6 +1,8 @@ > if ( KOHA === undefined ) var KOHA = {}; > >-KOHA.browser = function (searchid, biblionumber) { >+KOHA.browser = function (searchid, biblionumber, max_search_cookies) { >+ if (!max_search_cookies) max_search_cookies = 10; >+ > var me = this; > > if (!searchid) { >@@ -52,7 +54,7 @@ KOHA.browser = function (searchid, biblionumber) { > return ( elementOfArray.search(/^scs_\d/) != -1 ); //We are looking for specifically staff client searchCookies. > } > ); >- if (scsCookieKeys.length >= 10) { >+ if (scsCookieKeys.length >= max_search_cookies) { > scsCookieKeys.sort(); //Make sure they are in order, oldest first! > $.removeCookie( scsCookieKeys[0], { path: '/' } ); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index bc35aad..778d04b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -207,6 +207,11 @@ Cataloging: > yes: Display > no: "Don't display" > - acquisition details on the biblio detail page. >+ - >+ - Allow a maximum of >+ - pref: MaxSearchCookies >+ class: Integer >+ - search history cookies to be stored. > Importing: > - > - When matching on ISBN with the record import tool, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt >index 1c61305..7a2d8f2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Catalog › > [% IF ( unknownbiblionumber ) %] >@@ -14,7 +15,7 @@ > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.show(); > //]]> > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >index 698c960..7c2e778 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Catalog › > [% IF ( unknownbiblionumber ) %] >@@ -14,7 +15,7 @@ > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.show(); > > $(document).ready(function() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index b782616..6a6089b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -207,7 +207,7 @@ function verify_images() { > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.show(); > > function activate_filters(id) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt >index 957f6ce..c9edc94 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > > <title>Koha › Catalog › >@@ -17,7 +18,7 @@ > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.show(); > function Changefwk(FwkList) > { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index 1ddc952..e507c03 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Catalog › Item details for [% title %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -9,7 +10,7 @@ > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.show(); > //]]> > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 785da66..0fb71e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -139,7 +139,7 @@ $('#sort_by').change(function() { > [%- result.biblionumber %], > [%- END -%] > ]; >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.create([% SEARCH_RESULTS.first.result_number %], '[% query_cgi %]', '[% limit_cgi | uri %]','[% sort_cgi | uri %]', > newresults, '[% total %]'); > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 7c6b48d..bdaa3e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -11,7 +11,7 @@ > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.show(); > > $(window).load(function(){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 9cdc1cf..c289a46 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -1,3 +1,4 @@ >+[% Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Cataloging › [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) › Items</title> > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >@@ -11,7 +12,7 @@ > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >+ var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10), '[% Koha.Preference("MaxSearchCookies") %]' ); > browser.show(); > > $(document).ready(function(){ >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13265
:
33616
|
37973
|
39284
|
39391
|
39438
|
39948