Clear parentKey change marker after save
Fixes #1325, Field editor closes during auto-sync of newly created parent item
This commit is contained in:
parent
2baa537542
commit
fdb9e20076
2 changed files with 17 additions and 0 deletions
|
@ -438,6 +438,18 @@ describe("Zotero.Item", function () {
|
|||
assert.isFalse(item.hasChanged());
|
||||
});
|
||||
|
||||
it("should not be marked as changed after a save", async function () {
|
||||
var item = await createDataObject('item');
|
||||
var attachment = new Zotero.Item('attachment');
|
||||
attachment.attachmentLinkMode = 'linked_url';
|
||||
await attachment.saveTx();
|
||||
|
||||
attachment.parentKey = item.key;
|
||||
assert.isTrue(attachment._changed.parentKey);
|
||||
await attachment.saveTx();
|
||||
assert.isUndefined(attachment._changed.parentKey);
|
||||
});
|
||||
|
||||
it("should move a top-level note under another item", function* () {
|
||||
var noteItem = new Zotero.Item('note');
|
||||
var id = yield noteItem.saveTx()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue