diff --git a/chrome/content/zotero/xpcom/data/dataObjects.js b/chrome/content/zotero/xpcom/data/dataObjects.js index dbc472ea5d..5f9d648abb 100644 --- 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 index e60450a3df..0085beff32 100644 --- a/chrome/content/zotero/xpcom/data/tags.js +++ b/chrome/content/zotero/xpcom/data/tags.js @@ -396,6 +396,14 @@ Zotero.Tags = new function() { } + /** + * Internal reload hook to clear cache + */ + this._reload = function (ids) { + _tags = {}; + } + + /** * Unload tags from caches * @@ -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;