commit 539ac39d706c6b6a64280bcffc9fb8326736d524 parent 1f93fa405cde42e42ddd7d012aa33699186b6327 Author: Dan Stillman <dstillman@zotero.org> Date: Tue, 7 Sep 2010 18:39:05 +0000 Trigger Full Sync when trying to insert an item into a missing local library (though I think the causes of this have been addressed server-side) Diffstat:
| M | chrome/content/zotero/xpcom/data/item.js | | | 13 | ++++++++++++- |
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -1216,7 +1216,18 @@ Zotero.Item.prototype.save = function() { sql = sql.substring(0, sql.length-2) + ")"; // Save basic data to items table - var insertID = Zotero.DB.query(sql, sqlValues); + try { + var insertID = Zotero.DB.query(sql, sqlValues); + } + catch (e) { + if (this.libraryID + && ((e.indexOf && e.indexOf('fki_items_libraryID_libraries_libraryID') != -1) + || (!Zotero.Libraries.exists(this.libraryID)))) { + var msg = "Library " + this.libraryID + " for item " + this.key; + var e = new Zotero.Error(msg, "MISSING_OBJECT"); + throw (e); + } + } if (!itemID) { itemID = insertID; }