--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/9f0a97e1-e1dd-478f-942b-4de4ef2b2c50n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/LVmcjIMqYvA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/01000186a0db4538-43a285dc-f3af-4bd0-ab22-0b1df42df1a5-000000%40email.amazonses.com.
On Mar 2, 2023, at 11:01 AM, Dan Farrell <d...@cyrusbio.com> wrote:
Here is a minimal reproducible example. Missingobjecterror is returned in a group library but not in my own personal library.let basestr = "CONTENTSSSS";
let item = Zotero.getActiveZoteroPane().getSelectedItems()[0];
let parentitem = Zotero.Items.get(item.parentItemID);
let newNote = new Zotero.Item('note')
newNote.setNote(basestr);
newNote.parentID = parentitem.id;
await newNote.saveTx();
newNote
<image.png><image.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/CALq7ofqABKiK5FODcD1Nwpv-99eL37R1dxzAYMgVu%3DJc_XKiUQ%40mail.gmail.com.
Add:
newNote.libraryID = item.libraryID;
Setting parent[Item]ID doesn’t set libraryID, so it defaults to the user library and then fails because the user library doesn’t have an item with the parent item's key. (I think that’s a bug - we should set libraryID along with parentKey - but I’ll let others weigh in.)