Fix error: "[QUERY: DELETE FROM creatorData WHERE creatorDataID=?] [ERROR: constraint failed]"

This commit is contained in:
Dan Stillman 2009-03-16 07:09:30 +00:00
parent 4e7dfbad42
commit 468cd16534

View File

@ -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();