zotero-better-bibtex: JSON-RPC method `item.export` no longer works with `libraryID` from the CaYW endpoint

Debug log ID

Z6NY6TWW-refs-euc

What happened?

I’m encountering an issue with the Obsidian Zotero integration, which is now unable to import items from any library other than the default “My Library”.

The integration relies on the Cite as You Write (CaYW) endpoint and works as follows:

  1. It queries the CaYW endpoint to search for a citation.
  2. It then calls the item.export JSON-RPC method, passing:
    • the retrieved item.citationKey as the citekeys parameter
    • the corresponding item.libraryID as the libraryID parameter

This flow previously worked as expected for both the main library and group libraries. However, since commit b2446a6047bbf4faaa1b8b16a5d359c5f5c998f5, the item.export call fails when used with any libraryID other than 1. The new parse logic, if (typeof id.library === 'number') library = libraries.find(lib => lib.id === id.library), ends up comparing lib.id (which is actually the groupID) against what should be the libraryID. As a result, the lookup fails.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Can you test this build to see if it addresses the problem?

The issue with breaking the Obsidian Zotero Integration Plugin seems to be resolved.

OK, I will give it a look, but I am really busy today and the next two days are public holidays, so it might take me a minute…