mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
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.
This commit is contained in:
parent
b01ae24f18
commit
41449871a1
1 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue