OpenLibrary book covers don't appear on the search results or detail page in the OPAC. The console shows an error, "SyntaxError: missing ) after argument list books:1:16246"
I suspect a bug on their side: The answer of: https://openlibrary.org/api/books?bibkeys=ISBN%3A067002662X%2CISBN%3A1847727808%2CISBN%3A1780335792&callback=KOHA.OpenLibrary.olCallBack&jscmd=data is: KOHA.OpenLibrary.olCallBack(KOHA.OpenLibrary.olCallBack({"ISBN:067002662X": {"publish_date": "2013", [SKIP]
https://github.com/internetarchive/openlibrary/issues/1014
What is the expected answer? Is this a matter of JSON vs. JS or is this about the repeated "KOHA.OpenLibrary.olCallBack" in the answer? The latter isn't the case anymore so I wonder what's wrong as still doesn't work. Cheers
I stand corrected: I got rid of the duplication by adding "format=json" as additional query parameter. So that's a possible fix if the upstream change isn't a regression. Cheers
Created attachment 77752 [details] [review] Bug 21001: Add missing format=json to openlibrary calls See https://github.com/internetarchive/openlibrary/issues/1014 Test plan: Turn on OpenLibraryCovers and OpenLibrarySearch Do a search at the OPAC You should see the covers from OpenLibrary as well as the "Searching Open Library... " and "Found XXX results in OpenLibrary collection" info
Hi Jonathan, I'm not sure my workaround should become a solution just yet. For the time being I consider this to be an upstream API bug. So until that's cleared up upstream we probably should refrain from adjusting our query. The point being that the API docs at https://openlibrary.org/dev/docs/api/books clearly state that "callback" only makes sense in conjunction with "format=javascript" (the default), not "format=json". So either their current API or its documentation are buggy and they got to fix one of those. Cheers
Olivier, yes you are right. I wanted to provide a patch for people who wanted to patch their installation locally. It should not be pushed until the situation has been clarified.
Hi guys, the issue was fixed upstream and I can confirm that covers do appear again after I reverted my local patch. I'd say this ticket can be closed, ideally after someone else confirmed the fix independently. Cheers
Thanks, looks good on my side too.