Fix one or two tag errors resulting from an uncleared cache

This commit is contained in:
Dan Stillman 2008-12-26 01:10:55 +00:00
parent 2cfcec4d8e
commit b4c0df32cc
2 changed files with 14 additions and 0 deletions

View file

@ -104,6 +104,11 @@ Zotero.DataObjects = function (object, objectPlural, id, table) {
this._objectCache[id] = store[id]; this._objectCache[id] = store[id];
} }
// If there's an internal reload hook, call it
if (this._reload) {
this._reload(ids)
}
// Reload data // Reload data
this._load(ids); this._load(ids);

View file

@ -396,6 +396,14 @@ Zotero.Tags = new function() {
} }
/**
* Internal reload hook to clear cache
*/
this._reload = function (ids) {
_tags = {};
}
/** /**
* Unload tags from caches * Unload tags from caches
* *
@ -432,6 +440,7 @@ Zotero.Tags = new function() {
sql += " AND tagID IN (" + Zotero.join(arguments[0], ",") + ")"; sql += " AND tagID IN (" + Zotero.join(arguments[0], ",") + ")";
} }
var rows = Zotero.DB.query(sql); var rows = Zotero.DB.query(sql);
var ids = []; var ids = [];
for each(var row in rows) { for each(var row in rows) {
var id = row.tagID; var id = row.tagID;