From 78526d7795e4fcdd384cbeb66c8f4aca33d9d05f Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Thu, 16 Dec 2021 13:09:22 +0200 Subject: [PATCH] Include `annotationKey` when using "Add Item Note from Annotation" Fixes #2279 --- chrome/content/zotero/xpcom/editorInstance.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index 8a81597549..994143beea 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -303,7 +303,7 @@ class EditorInstance { } /** - * @param {Zotero.Item[]} annotations + * @param {Object[]} annotations JSON annotations * @param {Boolean} skipEmbeddingItemData Do not add itemData to citation items * @return {Object} Object with `html` string and `citationItems` array to embed into metadata container */ @@ -1457,6 +1457,7 @@ class EditorInstance { let attachmentItem = Zotero.Items.get(annotation.parentID); let jsonAnnotation = await Zotero.Annotations.toJSON(annotation); jsonAnnotation.attachmentItemID = attachmentItem.id; + jsonAnnotation.id = annotation.key; jsonAnnotations.push(jsonAnnotation); } let html = `

${Zotero.getString('pdfReader.annotations')}
`