[solved] connector: An error occurred saving with Cambridge Core
Hi,
I'm using Zotero connector in Firefox to try to add the following book from Cambridge Core to my collection:
https://www.cambridge.org/core/books/small-summaries-for-big-data/B41310C236A3D3574C273C42B71F35A4#
However, this fails with the message "An error occurred saving with Cambridge Core. Attempting to save using Embedded Metadata instead." and produces a Web Page item in my collection instead of the Book. Some metadata is collected, but ISBN, Publisher, and DOI are placed together in the Extra field, which is not ideal.
Saving other types of references (e.g. from the ACM Digital Library) works just fine so I suspect it's an issue with the translator for Cambridge Core.
I followed all the steps on the https://www.zotero.org/support/troubleshooting_translator_issues page.
I tried to submit some debug output, it should be found at Debug ID "D1154565129".
Thanks in advance for tips and help.
I'm using Zotero connector in Firefox to try to add the following book from Cambridge Core to my collection:
https://www.cambridge.org/core/books/small-summaries-for-big-data/B41310C236A3D3574C273C42B71F35A4#
However, this fails with the message "An error occurred saving with Cambridge Core. Attempting to save using Embedded Metadata instead." and produces a Web Page item in my collection instead of the Book. Some metadata is collected, but ISBN, Publisher, and DOI are placed together in the Extra field, which is not ideal.
Saving other types of references (e.g. from the ACM Digital Library) works just fine so I suspect it's an issue with the translator for Cambridge Core.
I followed all the steps on the https://www.zotero.org/support/troubleshooting_translator_issues page.
I tried to submit some debug output, it should be found at Debug ID "D1154565129".
Thanks in advance for tips and help.
So I went back to my book and noticed the trailing '#' at the end of the URL in by browser. Removing that makes the Cambridge Core translator work just fine for my book.
I think I got the extra # from interacting with elements on the page, which seems like a reasonable thing to do – the connector should probably keep working in this case. A potential robustness improvement?
Edit: reading the code, it appears like this should already be handled? https://github.com/zotero/translators/blob/master/Cambridge Core.js#L106
But still, in my debug output, the submitted query is for a productId ending with '#':
https://www.cambridge.org/core/services/aop-easybib/export?exportType=ris&productIds=B41310C236A3D3574C273C42B71F35A4#&citationStyle=apa
Manually accessing this URL gives the same HTTP 500, while removing the # from this query works (HTTP 200 and a .ris file)
Edit2: Refreshing my regex memory, it seems like it should actually be `[#?].*`, i.e. replacing the last quantifier + with * to match 0 or more characters following the #. The way it's written now will not replace the trailing # if it is not followed by anything (which is what happened to me). Would a pull request for this change be accepted?