www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 41449871a1ca5b1ad3f7516602aedad3cd2379ac
parent b01ae24f1811ffae6a5e3d79c8a261a764ac2e35
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 13 Apr 2013 03:41:32 -0400

Fix "Source item for keyed source doesn't exist" sync error

This could occur in 4.0 if a standalone attachment was modified locally
and remotely was changed into a child attachment.

Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -2837,7 +2837,20 @@ Zotero.Item.prototype.getFile = function(row, skipExistsCheck) { if (self.isTopLevelItem()) { return; } - Zotero.Items.get(self.getSource()).updateBestAttachmentState(); + + try { + var parentKey = self.getSource(); + } + // This can happen during classic sync conflict resolution, if a + // standalone attachment was modified locally and remotely was changed + // into a child attachment + catch (e) { + Zotero.debug("Attachment parent doesn't exist for source key " + + "in Zotero.Item.updateAttachmentStates()", 1); + return; + } + + Zotero.Items.get(parentKey).updateBestAttachmentState(); }; // No associated files for linked URLs