Don't unload object on save error if not new
This commit is contained in:
parent
79a07cad9e
commit
76bc61e882
1 changed files with 10 additions and 8 deletions
|
@ -909,14 +909,16 @@ Zotero.DataObject.prototype._initSave = Zotero.Promise.coroutine(function* (env)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Undo registerObject() on failure
|
// Undo registerObject() on failure
|
||||||
var func = function () {
|
if (env.isNew) {
|
||||||
this.ObjectsClass.unload(this._id);
|
var func = function () {
|
||||||
}.bind(this);
|
this.ObjectsClass.unload(this._id);
|
||||||
if (env.options.tx) {
|
}.bind(this);
|
||||||
env.transactionOptions.onRollback = func;
|
if (env.options.tx) {
|
||||||
}
|
env.transactionOptions.onRollback = func;
|
||||||
else {
|
}
|
||||||
Zotero.DB.addCurrentCallback("rollback", func);
|
else {
|
||||||
|
Zotero.DB.addCurrentCallback("rollback", func);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
env.relationsToRegister = [];
|
env.relationsToRegister = [];
|
||||||
|
|
Loading…
Reference in a new issue