diff --git a/chrome/content/zotero/xpcom/data/creator.js b/chrome/content/zotero/xpcom/data/creator.js index d61a65566..f9756c5e0 100644 --- a/chrome/content/zotero/xpcom/data/creator.js +++ b/chrome/content/zotero/xpcom/data/creator.js @@ -212,10 +212,10 @@ Zotero.Creator.prototype.save = function () { var creatorDataID = this.creatorDataID; } // Existing data row with the new data -- switch to that - // and delete old row + // and flag old row for deletion below else if (newCreatorDataID) { + var deleteDataID = this.creatorDataID; var creatorDataID = newCreatorDataID; - Zotero.Creators.deleteData(this.creatorDataID); } // Update current data row with new data else { @@ -249,6 +249,10 @@ Zotero.Creator.prototype.save = function () { creatorID = insertID; } + if (deleteDataID) { + Zotero.Creators.deleteData(deleteDataID); + } + if (this.id) { Zotero.debug("Updating linked items"); this.updateLinkedItems();