diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index f512f9fc38..d100911bce 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -1229,8 +1229,10 @@ Zotero.Utilities.Internal = { if (!key || key != 'type' || skipKeys.has(key) - // Ignore 'type: note' and 'type: attachment' - || ['note', 'attachment'].includes(value)) { + // 1) Ignore 'type: note' and 'type: attachment' + // 2) Ignore 'article' until we have a Preprint item type + // (https://github.com/zotero/translators/pull/2248#discussion_r546428184) + || ['note', 'attachment', 'article'].includes(value)) { return true; } diff --git a/test/tests/itemTest.js b/test/tests/itemTest.js index 650da004c7..a6d29c1883 100644 --- a/test/tests/itemTest.js +++ b/test/tests/itemTest.js @@ -1896,6 +1896,17 @@ describe("Zotero.Item", function () { assert.equal(item.getField('extra'), 'Pages: 123'); }); + it("shouldn't convert 'Type: article' from Extra into Document item", function () { + var json = { + itemType: "report", + extra: "Type: article" + }; + var item = new Zotero.Item; + item.fromJSON(json); + assert.equal(Zotero.ItemTypes.getName(item.itemTypeID), 'report'); + assert.equal(item.getField('extra'), 'Type: article'); + }); + it("should ignore creator field in Extra", async function () { var json = { itemType: "journalArticle",