emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] oc-basic.el: Fix wrong type for the editors field when parsing J


From: Hugo Cisneros
Subject: [PATCH] oc-basic.el: Fix wrong type for the editors field when parsing JSON.
Date: Tue, 20 Dec 2022 18:03:42 +0100

I use org-cite with a JSON bibliography and noticed a bug when an entry only has
an "editors" field but no "authors" field. The function
`org-cite-basic—get-author' correctly falls back to using the editors instead of
the authors, but `org-cite-basic--parse-json’ stringifies only the "authors"
field and not the "editors." This creates an error when other functions assume
they got a string from `org-cite-basic—get-author'. The patch fixes the issue by
applying the same transformation to both "authors" and "editors".

As explained in the ChangeLog entry, this points to a more general issue where
`org-cite-basic--get-field' is expected to return nil or a string, but calls
`org-cite-basic--get-entry' that may return an association list. I am not sure
how to fix that since it means converting anything that
`org-cite-basic--get-entry' may return into a string.



Attachment: oc-basic.el.patch
Description: Binary data


Hugo Cisneros

reply via email to

[Prev in Thread] Current Thread [Next in Thread]