From 63864f2f86c6a1862e86e218d4ed7b5b879dec4e Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 29 Aug 2022 16:15:31 -0400 Subject: [PATCH] duplicateAndConvertSelectedItem: Don't copy abstracts (#2799) --- chrome/content/zotero/zoteroPane.js | 2 ++ test/tests/zoteroPaneTest.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 301d2b6c2a..a7c54582cf 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1853,6 +1853,8 @@ var ZoteroPane = new function() duplicate.setCreators(creators); } + duplicate.setField('abstractNote', ''); + duplicate.addRelatedItem(original); original.addRelatedItem(duplicate); diff --git a/test/tests/zoteroPaneTest.js b/test/tests/zoteroPaneTest.js index 0c40a754c9..f951ea9e1f 100644 --- a/test/tests/zoteroPaneTest.js +++ b/test/tests/zoteroPaneTest.js @@ -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')); + }); });