commit 45e761449fd0832628766f800d0955c4245b15c3 parent 305b6dc89113575fbdd69c357a7862b3ed5fefcd Author: Dan Stillman <dstillman@zotero.org> Date: Tue, 1 Sep 2009 07:54:53 +0000 Fix "constraint failed" error on itemCreators during sync Diffstat:
| M | chrome/content/zotero/xpcom/sync.js | | | 11 | ++++++----- |
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js @@ -3143,12 +3143,13 @@ Zotero.Sync.Server.Data = new function() { var e = new Zotero.Error(msg, "MISSING_OBJECT"); throw (e); } - var l = creator.@libraryID.toString(); - l = l ? l : null; + + creator.creator.@libraryID = data.libraryID; var creatorObj = Zotero.Sync.Server.Data.xmlToCreator(creator.creator); - if (l != creatorObj.libraryID || creator.@key.toString() != creatorObj.key) { - throw ("Creator id " + creatorObj.id + " does not match " - + "item creator in Zotero.Sync.Server.Data.xmlToItem()"); + + if (creator.@key.toString() != creatorObj.key) { + throw ("Creator does not match item creator in Zotero.Sync.Server.Data.xmlToItem() " + + "(" + creator.@key.toString() + "!=" + creatorObj.key + ")"); } } item.setCreator(