duplicateAndConvertSelectedItem: Don't copy abstracts (#2799)
This commit is contained in:
parent
75f5d6aca1
commit
c255104ada
2 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue