This prevents empty requests being sent to content providers.
This caused a problem for us because invalid ISBNs were causing
requests to Content Cafe to fail, since Content Cafe returns an
error if there is a blank key sent along with valid ISBNs and UPCs.
Specifically we had problems with DVD records from Baker & Taylor because
B&T creates unoffical ISBNs for the DVDs they sell. Those ISBN's do
not validate when run through B::ISBN.
ISSNs are also cleaned since they are validated and set to undef if
invalid just like ISBNs are.
It shouldn't hurt to not send blank requests to providers in any case.
To test:
1. I know this is a problem with Content Cafe, I don't
know if any other providers are effected. Let me know
if you need Content Cafe credentials to test.
2. Add an invalid ISBN 020a entry to a bib record that has added content.
9786316271976 is an example of a fake ISBN that doesn't
pass B::ISBN validation. Or just make up a fake number.
3. Clear out the memcache entries for that record. In 2.9+ there
is a link to clear the cache in the record detail view under Permalink.
4. Reload the record and the cover art and other added content should
not be displayed. This is because the invalid ISBN gets set to undef
, and the undef gets sent to content cafe as a blank key request.
5. Now apply the fix. Clear the memcache entries for that bib, and now
the cover art should be displayed since the undef entries due to the invalid
ISBN's have been removed.
Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>