Bug: "Insert Citation" not working when certain style is missing
I changed my data directory to an empty directory to get a new library. Then, when I'm taking notes, the "Insert Citation" function in this new library stops working (see error report id: 2112781744). The error says "getCiteProc is not a function".
The new data directory lacks several styles (in "styles/" directory) that I possibly added some time before. By copying these styles to the new data directory, "Insert Citation" starts working.
This suggests that some function assumes certain style to be exist (though I can't recall any possible operation that may cause it to rely on user-added styles).
Is it possible to improve the code, so that it uses another style when certain style is missing?
(Also, see this issue, which also discusses this problem: https://github.com/dvanoni/notero/issues/12. They said, "the code assumes that the APA style is available and uses it to generate the name of the Notion page".)
The new data directory lacks several styles (in "styles/" directory) that I possibly added some time before. By copying these styles to the new data directory, "Insert Citation" starts working.
This suggests that some function assumes certain style to be exist (though I can't recall any possible operation that may cause it to rely on user-added styles).
Is it possible to improve the code, so that it uses another style when certain style is missing?
(Also, see this issue, which also discusses this problem: https://github.com/dvanoni/notero/issues/12. They said, "the code assumes that the APA style is available and uses it to generate the name of the Notion page".)
- https://github.com/mgmeyers/obsidian-zotero-integration/issues/294
- https://github.com/dvanoni/notero/issues/12
- https://github.com/dvanoni/notero/issues/258
- https://github.com/windingwind/zotero-actions-tags/discussions/165#discussioncomment-8013432
- https://github.com/dvanoni/notero/issues/295
This can be reproduced in Zotero without any add-ons by uninstalling the main APA style and then trying to insert a citation in a note: this inserts a {citation} placeholder with no further error message (tested in current beta)
"C:\Users\lienart\Zotero\styles\apa.csl"
But it doesn't generate the error. The apa.csl file is somehow downloaded again when inserting a citation using the APA style.
(The format is hard-coded and doesn't rely on a specific style, so nothing specific to APA, but it unnecessarily called some citeproc.js code, and if the last-selected citation style no longer existed, it failed.)
The issues in the Notero plugin mentioned above are caused by a reliance on the APA style, but all I really want is to generate a citation in the "(Author, Date)" format like Zotero does when you insert a citation in a note. If I can do this without having to rely on the presence of the APA style, that would be great.