From 51bd2fbb982380432979e5d1cbb0c23a0f5ff7a4 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Mon, 19 Mar 2012 11:08:08 -0400 Subject: [PATCH] AutoSuggest: Don't try to store cmc and cmf caches in a cookie. Too big. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Mike Rylander --- Open-ILS/web/js/dojo/openils/AutoSuggestStore.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js b/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js index e985183d54..5e134a106b 100644 --- a/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js +++ b/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js @@ -51,13 +51,8 @@ if (!dojo._hasResource["openils.AutoSuggestStore"]) { if (this.cm_cache[key]) return; - var cookie = dojo.cookie("OILS_AS" + key); - if (cookie) { - this.cm_cache[key] = dojo.fromJson(cookie); - return oncomplete(); - } - - /* now try to get it from open-ils.searcher */ + /* Try to get cache of cmc's or cmf's from + * openils.widget.Searcher */ try { /* openils.widget.Searcher may not even be loaded; * that's ok; just try. */ @@ -81,17 +76,13 @@ if (!dojo._hasResource["openils.AutoSuggestStore"]) { "params": [{"query": query, "fields": field_list}], "async": true, "oncomplete": function(r) { - /* XXX check for failure? */ - var result_arr = r.recv().content(); + var result_arr = openils.Util.readResponse(r); self.cm_cache[key] = {}; dojo.forEach( result_arr, function(o) { self.cm_cache[key][o[pkey]] = o; } ); - dojo.cookie( - "OILS_AS" + key, dojo.toJson(self.cm_cache[key]) - ); oncomplete(); } }).send(); -- 2.11.0