Merging duplicates in a group library fails when both PDF attachments have an attachment note ("Pare
Zotero 10.0.8, Windows 11.
Merging two duplicate items in a group library fails with
```
ZoteroMissingObjectError: Parent item 1/XXXXXXXX not found
```
when Zotero combines their PDFs (same file or same text) and both PDF attachments have an attachment note (the note field of the attachment itself). The merge is rolled back. In My Library, the same merge works.
Steps to reproduce:
1. In a group library, create two duplicate items, each with a stored copy of a PDF with the same text.
2. Give each PDF attachment an attachment note.
3. Merge the two items. We hit this through `mergeItems()` from `chrome/content/zotero/mergeItems.mjs` in a batch merge; the Duplicate Items pane uses the same function.
Cause: `moveEmbeddedNote()` in `mergeItems.mjs` creates the extra note like this when both attachments have a note:
```
noteItem = new Zotero.Item('note');
noteItem.parentItemID = toItem.parentItemID;
```
Setting `parentItemID` sets only the parent key, not the library. `_initSave()` then puts the new note into the user library (the "1/" in the error), where the parent key does not exist. Every such merge in a group library fails.
Suggested fix:
```
noteItem = new Zotero.Item('note');
noteItem.libraryID = toItem.libraryID;
noteItem.parentItemID = toItem.parentItemID;
```
The code is unchanged in the current main branch (around line 417). A 2023 zotero-dev thread hit the same root cause in a script, where Abe Jellinek wrote "I think that's a bug - we should set libraryID along with parentKey": https://groups.google.com/g/zotero-dev/c/LVmcjIMqYvA
Merging two duplicate items in a group library fails with
```
ZoteroMissingObjectError: Parent item 1/XXXXXXXX not found
```
when Zotero combines their PDFs (same file or same text) and both PDF attachments have an attachment note (the note field of the attachment itself). The merge is rolled back. In My Library, the same merge works.
Steps to reproduce:
1. In a group library, create two duplicate items, each with a stored copy of a PDF with the same text.
2. Give each PDF attachment an attachment note.
3. Merge the two items. We hit this through `mergeItems()` from `chrome/content/zotero/mergeItems.mjs` in a batch merge; the Duplicate Items pane uses the same function.
Cause: `moveEmbeddedNote()` in `mergeItems.mjs` creates the extra note like this when both attachments have a note:
```
noteItem = new Zotero.Item('note');
noteItem.parentItemID = toItem.parentItemID;
```
Setting `parentItemID` sets only the parent key, not the library. `_initSave()` then puts the new note into the user library (the "1/" in the error), where the parent key does not exist. Every such merge in a group library fails.
Suggested fix:
```
noteItem = new Zotero.Item('note');
noteItem.libraryID = toItem.libraryID;
noteItem.parentItemID = toItem.parentItemID;
```
The code is unchanged in the current main branch (around line 417). A 2023 zotero-dev thread hit the same root cause in a script, where Abe Jellinek wrote "I think that's a bug - we should set libraryID along with parentKey": https://groups.google.com/g/zotero-dev/c/LVmcjIMqYvA
Upgrade Storage