External annotations ignored when merging
I have the same PDF file in my library in Zotero and outside Zotero. I add annotations in the external file with an external PDF viewer. Then I add that file to Zotero (drag and drop the file to Zotero) to merge the annotations with what I have already in Zotero.
If I open the PDF file in Zotero after adding it, Zotero finds the external annotations. Then the external annotations are correctly merged with the annotations in Zotero when merging items: only one PDF file is retained with annotations from both files.
But if I try to merge the items before opening the external file in Zotero, it does not see the external annotations, and the external annotations disappear during merging.
Is it possible to check external annotations when adding the file in Zotero, so that these annotations do not disappear when merging?
Tested on Windows 10
Zotero 7.0.0-beta.16+1766f8bb5 (64-bit), but also happening with the stable version.
If I open the PDF file in Zotero after adding it, Zotero finds the external annotations. Then the external annotations are correctly merged with the annotations in Zotero when merging items: only one PDF file is retained with annotations from both files.
But if I try to merge the items before opening the external file in Zotero, it does not see the external annotations, and the external annotations disappear during merging.
Is it possible to check external annotations when adding the file in Zotero, so that these annotations do not disappear when merging?
Tested on Windows 10
Zotero 7.0.0-beta.16+1766f8bb5 (64-bit), but also happening with the stable version.
Steps to reproduce:
1) Make an external copy of a PDF file from a Zotero item to outside of Zotero
2) Add annotations in the PDF file outside of Zotero (for example with Adobe Acrobat)
3) Drag and drop the external PDF file in the same library as the original item in Zotero
4) For me, it automatically creates a parent item
5) Open the imported PDF file in Zotero (this guaranties that the external annotations are still visible after merging).
6) Merge the original and the imported items. At this stage, the merged item has one single PDF file attachment with the locked annotations from the imported file (and eventually Zotero annotations that were made in the original item).
7) Click on "Import Annotations...". After this, all annotations from the external file simply disappear (the original Zotero annotations remain).
This error appears during merging:
[JavaScript Error: "this._id(...) is null" {file: "chrome://zotero/content/elements/relatedBox.js" line: 131}]
Debug ID D647715572
Tested on Windows 10
Zotero 7.0.0-beta.16+1766f8bb5 (64-bit)
If you do the "Important Annotations..." before merging (step 7 before step 6), the external annotations are extracted correctly, and correctly merged with the original item after merging.
I can't reproduce the disappearing annotations issue.
And by annotations, I have actually just made some highlights in the external PDF viewer.
I can reproduce on a fresh install of Zotero 7.0.0-beta.17+8017b2ab1 (64-bit) on a fresh Windows 11 OS. See screen recording at 1:26 for the annotations to disappear.
Debug ID: D179178798 The PDF files are exactly the same except the annotations. As you can see in the screen recording at 1:14, the merging of the items with the original and the annotated PDF files only leaves one attached PDF file in the merged item. The annotations are still visible at this stage.
The problem is worse: if I reproduce the steps 1 to 7, the annotations actually disappear in step 6 now instead of step 7. So the annotations are not deleted by the "Import Annotations..." step, but directly at the merging step.
Debug ID: D443444324
Now the merging step keeps both files, even though they are exactly the same.
I was expecting to simply merge the annotations into Zotero keeping a single PDF file, with some kind of warning that the annotations would be imported to Zotero.
Even if I do the "Import Annotations..." step before merging, Zotero is still not able to merge the annotations into a single file, still keeping 2 files while they are strictly the same. This was what it was doing previously, which was what I was expecting.
I have narrowed it down to a merging problem without any annotations involved. I apply the same process to two different PDF files and get two different behaviours... Simply saving the file in Adobe Acrobat Reader (Continuous Release, Version 2023.003.20244, 64 bits) without any modification to the PDF file can trigger that Zotero does not recognize that it is the same file (for some files...). Any idea?
Screen recording
Debug ID: D1036754112
If I import the file from the Zotero database into a new item and then also import the saved file into a new item, merging these two works properly, leaving only one PDF file, while the exact same files would leave two files in the process above.
The files originally in Zotero were imported from the publisher's page in Chrome.
Hopefully you can figure out the logic behind.
I have sent the files to support@zotero.org if that is useful.