commit d421f2587873ce55a0494cbd90876ea7cc7e6741
parent b921d5ac3155ce045b86356e88a3dea915b5c5fd
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 4 Nov 2009 06:25:56 +0000
- Fix "itemID 'undefined' not an integer in Zotero.Item.addRelatedItem()" sync error
- Allow last remote sync times to be decimals
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js
@@ -1025,7 +1025,7 @@ Zotero.Sync.Server = new function () {
return Zotero.DB.valueQuery("SELECT version FROM version WHERE schema='lastremotesync'");
});
this.__defineSetter__("lastRemoteSyncTime", function (val) {
- Zotero.DB.query("REPLACE INTO version VALUES ('lastremotesync', ?)", { int: val });
+ Zotero.DB.query("REPLACE INTO version VALUES ('lastremotesync', ?)", val);
});
this.__defineGetter__("lastLocalSyncTime", function () {
return Zotero.DB.valueQuery("SELECT version FROM version WHERE schema='lastlocalsync'");
@@ -2739,6 +2739,12 @@ Zotero.Sync.Server.Data = new function() {
var item = Zotero.Items.getByLibraryAndKey(lk.libraryID, lk.key);
for each(var relKey in relatedItemsStore[libraryKeyHash]) {
var relItem = Zotero.Items.getByLibraryAndKey(lk.libraryID, relKey);
+ if (!relItem) {
+ var msg = "Related item doesn't exist in Zotero.Sync.Server.Data.processUpdatedXML() "
+ + "(" + lk.libraryID + "/" + relKey + ")";
+ var e = new Zotero.Error(msg, "MISSING_OBJECT");
+ throw (e);
+ }
item.addRelatedItem(relItem.id);
}
item.save();