Fix error: "[QUERY: DELETE FROM creatorData WHERE creatorDataID=?] [ERROR: constraint failed]"
This commit is contained in:
parent
4e7dfbad42
commit
468cd16534
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user