From 764d1b006e2ea85205378bc30f2836a49474a6ce Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Fri, 30 Sep 2022 09:40:35 +0300 Subject: [PATCH] Import external annotations before trying to add a note from annotations (cherry picked from commit 9691fcafc2126b61bb806ceb64e5dedccee5b1fb) --- chrome/content/zotero/zoteroPane.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 73462131bf..520b5aa868 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -5032,6 +5032,12 @@ var ZoteroPane = new function() var annotations = []; for (let attachment of attachments) { + try { + await Zotero.PDFWorker.import(attachment.id, true); + } + catch (e) { + Zotero.logError(e); + } annotations.push(...attachment.getAnnotations()); } var note = await Zotero.EditorInstance.createNoteFromAnnotations( @@ -5122,6 +5128,12 @@ var ZoteroPane = new function() continue; } for (let attachment of attachments) { + try { + await Zotero.PDFWorker.import(attachment.id, true); + } + catch (e) { + Zotero.logError(e); + } annotations.push(...attachment.getAnnotations()); } }