diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index b2bcf97b9c..62a948d5cb 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3075,6 +3075,7 @@ var ZoteroPane = new function() function attachmentsWithExtractableAnnotations(item) { + if (!item.isRegularItem()) return []; return Zotero.Items.get(item.getAttachments()) .filter(item => isAttachmentWithExtractableAnnotations(item)); } diff --git a/test/tests/zoteroPaneTest.js b/test/tests/zoteroPaneTest.js index d66974ffbf..cfc0384d44 100644 --- a/test/tests/zoteroPaneTest.js +++ b/test/tests/zoteroPaneTest.js @@ -801,4 +801,14 @@ describe("ZoteroPane", function() { assert.lengthOf(Object.keys(conditions), 3); }); }); + + describe("#buildItemContextMenu()", function () { + it("should build menu for multiple standalone file attachments", async function () { + var item1 = await importFileAttachment('test.png'); + var item2 = await importFileAttachment('test.png'); + + await zp.selectItems([item1.id, item2.id]); + await zp.buildItemContextMenu(); + }); + }); })