]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1549393 - Remove undef values from isbn and issn arrays.
authorJosh Stompro <stomproj@larl.org>
Sat, 27 Feb 2016 14:54:04 +0000 (08:54 -0600)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 14 Mar 2016 18:53:05 +0000 (14:53 -0400)
commit7fc7d5a16ed4e3ae2c7d5a5ba2bd1425f0282361
tree2629ba566a4c81820cc8232d055568efa318e795
parentee8b6da78892595c97447cd17f54c2a7dbfa9458
LP#1549393 - Remove undef values from isbn and issn arrays.

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>
Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm