From 45e761449fd0832628766f800d0955c4245b15c3 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 1 Sep 2009 07:54:53 +0000 Subject: [PATCH] Fix "constraint failed" error on itemCreators during sync --- 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 index 1dd33ea71..f05357dc7 100644 --- 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(