commit b4c0df32ccb1ee4d2c80e0295727df33e654e2b6
parent 2cfcec4d8ef8edca39b678f4147fc50868675957
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 26 Dec 2008 01:10:55 +0000
Fix one or two tag errors resulting from an uncleared cache
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/dataObjects.js b/chrome/content/zotero/xpcom/data/dataObjects.js
@@ -104,6 +104,11 @@ Zotero.DataObjects = function (object, objectPlural, id, table) {
this._objectCache[id] = store[id];
}
+ // If there's an internal reload hook, call it
+ if (this._reload) {
+ this._reload(ids)
+ }
+
// Reload data
this._load(ids);
diff --git a/chrome/content/zotero/xpcom/data/tags.js b/chrome/content/zotero/xpcom/data/tags.js
@@ -397,6 +397,14 @@ Zotero.Tags = new function() {
/**
+ * Internal reload hook to clear cache
+ */
+ this._reload = function (ids) {
+ _tags = {};
+ }
+
+
+ /**
* Unload tags from caches
*
* @param int|array ids One or more tagIDs
@@ -432,6 +440,7 @@ Zotero.Tags = new function() {
sql += " AND tagID IN (" + Zotero.join(arguments[0], ",") + ")";
}
var rows = Zotero.DB.query(sql);
+
var ids = [];
for each(var row in rows) {
var id = row.tagID;