]> git.evergreen-ils.org Git - working/Evergreen.git/commit
LP#1549393 - Remove undef values from isbn and issn arrays. user/stompro/lp1549393_remove_undef_isbn_added_content
authorJosh Stompro <stomproj@larl.org>
Sat, 27 Feb 2016 14:54:04 +0000 (08:54 -0600)
committerJosh Stompro <stomproj@larl.org>
Sat, 27 Feb 2016 14:54:04 +0000 (08:54 -0600)
commit15890219867ea44524a36b8becfaa12594984927
tree00a466ba7f5019da17394d489c7cac7469e15fa2
parent4d2179dc437dbfc945bce6e38cad8af7ef5a0963
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>
Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm