retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.4k stars 289 forks source link

Fix annotation retrieval error potentially caused by pull request 2936 #2951

Closed bassio closed 3 months ago

bassio commented 3 months ago

Hello,

I started getting errors with retrieving annotations with Items that have multiple attachments that include a non file attachment e.g. a pubmed abstract

This is the error.

code: -32603 message: "Error: getAnnotations() can only be called on file attachments"

Zotero 7 appears to stubbornly error out if you call getAnnotations on a non file attachment e.g. pubmed abstract or link, note etc.

I believe the isPDF check removed recently in pull request 2936 may have caused this problem. https://github.com/retorquere/zotero-better-bibtex/pull/2936/files

I have replaced the isPDFAttachment this time with isFileAttachment to include the new epub and html attachments in Zotero 7.

Another approach is to catch an error in a try catch manner, maybe you think it is better this way.

Please check first my changes not causing any issues, since I did the edits the quick-and-dirty way in the browser via "github.dev" and unable to check

Thank you for great plugin!

Cheers

mgmeyers commented 3 months ago

Ah, sorry about this. Could have sworn I tested non-file attachments. Thanks for the fix @bassio . @retorquere would it be possible to get a release with this fix?

retorquere commented 3 months ago

I thought I already did. .224 is running through the release tests.