dsifford / academic-bloggers-toolkit

WordPress plugin providing an all-in-one solution for effective academic blogging.
https://wordpress.org/plugins/academic-bloggers-toolkit/
GNU General Public License v3.0
120 stars 38 forks source link

Error inserting citations using Elsevier styles #543

Closed spaulaus closed 5 years ago

spaulaus commented 5 years ago

ABT Version: 5.0.2

PHP Version: 7.2

Theme: http://themeworx.net/details/corporate/corpworx

Plugin List:

Browser: Google Chrome 72.0.3626.96

Expected behavior/Steps to reproduce:

  1. Enabled Elsevier (numeric, with titles) reference type. Confirmed with other variants of the Elsevier numeric styles.
  2. Add reference from DOI:
    • Breaks when cited: 10.1063/1.3586170
    • Works when cited: 10.1016/j.apradiso.2004.02.024 image
  3. Type text, select reference, and click "Insert Citation" image
  4. Citation is inserted.
  5. Bibliography block is added / updated

    Actual behavior: The citation is inserted, but the bibliography block is destroyed. image.

    Console messages: https://gist.github.com/spaulaus/362776a566cf14a31b6e54302c54e966

dsifford commented 5 years ago

I wish more people would report issues like you.

Thanks for the clarity. I'll try to look into this soon.

spaulaus commented 5 years ago

No problem! We're all in this together. Let me know if you need additional information.

dsifford commented 5 years ago

@spaulaus Goooooooooooooood find. Just got this sorted out locally. This was a pretty wild edge case. Glad to get it smoothed out.

I'll be pushing an update soon that includes the fix for this and a fix for a recent bug in wordpress core preventing the proper storage of citation metadata in postmeta.

Thanks again.

spaulaus commented 5 years ago

@dsifford : Awesome! Thanks for the quick turn around. Confirmed as working from my side. Out of curiosity, what was it about that DOI that caused the problem?

image

dsifford commented 5 years ago

The data returned from crosscite is in a format that is not aligned with the CSL JSON specification (even though they claim to be). So when processing that particular style, when it hit a field that had the incorrect type, a cascading error occurred.

spaulaus commented 5 years ago

Ah! The old documentation switcheroo. Thanks again for your help with this!