Bugzilla – Attachment 25729 Details for
Bug 11369
Too many search cursor cookies overflow HTTP-header size, when making multiple searches in the staff client.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11369 - Updating the jquery.cookie.js-plugin
Bug-11369---Updating-the-jquerycookiejs-plugin.patch (text/plain), 3.84 KB, created by
Kyle M Hall (khall)
on 2014-02-28 16:46:06 UTC
(
hide
)
Description:
Bug 11369 - Updating the jquery.cookie.js-plugin
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-02-28 16:46:06 UTC
Size:
3.84 KB
patch
obsolete
>From 21ea7e596dd4facbad6f8877abdfdd47c16d71f8 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Tue, 10 Dec 2013 19:12:01 +0200 >Subject: [PATCH] Bug 11369 - Updating the jquery.cookie.js-plugin > >The current jquery.cookie-plugin crashes when trying to fetch all cookies using $.cookie(); >Downloaded the newest plugin version and minified it. >Now works as intended. > >Encountered an issue with the plugin now returning null when no cookies are found, >and applied a fix in browser.js. > >------------- >- Test plan - >------------- >Plugin is used in browser.js and batchMod.js so testing both > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/js/browser.js | 5 ++++- > .../lib/jquery/plugins/jquery.cookie.min.js | 2 +- > 2 files changed, 5 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js >index fd99bb1..c3c1516 100644 >--- a/koha-tmpl/intranet-tmpl/js/browser.js >+++ b/koha-tmpl/intranet-tmpl/js/browser.js >@@ -5,7 +5,10 @@ KOHA.browser = function (searchid, biblionumber) { > this.searchid = searchid; > > if (me.searchid) { >- me.searchCookie = JSON.parse($.cookie(searchid)); >+ var cookie = $.cookie(searchid) >+ if (cookie) { >+ me.searchCookie = JSON.parse(cookie); >+ } > } > > var browseRecords = function (searchid, movement) { >diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.cookie.min.js b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.cookie.min.js >index eb129db..2ec98c0 100644 >--- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.cookie.min.js >+++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.cookie.min.js >@@ -1 +1 @@ >-jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}}; >\ No newline at end of file >+(function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function r(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function s(e){if(e.indexOf('"')===0){e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{e=decodeURIComponent(e.replace(t," "))}catch(n){return}try{return u.json?JSON.parse(e):e}catch(n){}}function o(t,n){var r=u.raw?t:s(t);return e.isFunction(n)?n(r):r}var t=/\+/g;var u=e.cookie=function(t,s,a){if(s!==undefined&&!e.isFunction(s)){a=e.extend({},u.defaults,a);if(typeof a.expires==="number"){var f=a.expires,l=a.expires=new Date;l.setDate(l.getDate()+f)}return document.cookie=[n(t),"=",i(s),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=t?undefined:{};var h=document.cookie?document.cookie.split("; "):[];for(var p=0,d=h.length;p<d;p++){var v=h[p].split("=");var m=r(v.shift());var g=v.join("=");if(t&&t===m){c=o(g,s);break}if(!t&&(g=o(g))!==undefined){c[m]=g}}return c};u.defaults={};e.removeCookie=function(t,n){if(e.cookie(t)!==undefined){e.cookie(t,"",e.extend({},n,{expires:-1}));return true}return false}}) >\ No newline at end of file >-- >1.7.2.5
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 11369
:
23389
|
23390
|
25662
|
25663
|
25667
|
25669
|
25729
|
25730
|
25731
|
25732
|
26501
|
26502
|
26503
|
26504