duplicateAndConvertSelectedItem: Don't copy abstracts (#2799)

This commit is contained in:
Abe Jellinek 2022-08-29 16:15:31 -04:00 committed by GitHub
parent b646073dfa
commit 63864f2f86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -1853,6 +1853,8 @@ var ZoteroPane = new function()
duplicate.setCreators(creators);
}
duplicate.setField('abstractNote', '');
duplicate.addRelatedItem(original);
original.addRelatedItem(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'));
});
});