duplicateAndConvertSelectedItem: Don't copy abstracts (#2799)

This commit is contained in:
Abe Jellinek 2022-08-29 16:15:31 -04:00
parent 75f5d6aca1
commit c255104ada
2 changed files with 13 additions and 1 deletions

View file

@ -1860,12 +1860,14 @@ var ZoteroPane = new function()
duplicate.setCreators(creators);
}
duplicate.setField('abstractNote', '');
duplicate.addRelatedItem(original);
original.addRelatedItem(duplicate);
await original.saveTx({ skipDateModifiedUpdate: true });
await duplicate.saveTx();
document.getElementById('zotero-editpane-item-box').focusField('title');
return duplicate;
};

View file

@ -467,6 +467,16 @@ describe("ZoteroPane", function() {
assert.sameMembers(bookSectionItem2.relatedItems, [bookItem.key, otherBookSection.key]);
});
});
it("should not copy abstracts", async function() {
await selectLibrary(win);
var bookItem = await createDataObject('item', { itemType: 'book', title: "Book Title" });
bookItem.setField('abstractNote', 'An abstract');
bookItem.saveTx();
var bookSectionItem = await zp.duplicateAndConvertSelectedItem();
assert.isEmpty(bookSectionItem.getField('abstractNote'));
});
});