[open-ils-commits] [GIT] Evergreen ILS branch rel_2_10 updated. 436dd3dd825a9f6f5245f8cfc96449e942f9e2b3

Evergreen Git git at git.evergreen-ils.org
Mon Mar 14 14:53:39 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_10 has been updated
       via  436dd3dd825a9f6f5245f8cfc96449e942f9e2b3 (commit)
      from  5ea850143880cccf233c5a55d6bfdb67acfe32e0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 436dd3dd825a9f6f5245f8cfc96449e942f9e2b3
Author: Josh Stompro <stomproj at larl.org>
Date:   Sat Feb 27 08:54:04 2016 -0600

    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 at larl.org>
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
index a1f1767..254d790 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
@@ -181,6 +181,11 @@ sub handler {
             undef $_ if !defined($_->{value});
         } @issns;
 
+        #Remove undef values from @isbns and @issns.
+        #Prevents empty requests to providers
+        @isbns = grep {defined} @isbns;
+        @issns = grep {defined} @issns;
+
         $keyhash = {
             isbn => [map {$_->{value}} @isbns],
             issn => [map {$_->{value}} @issns],

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/lib/OpenILS/WWW/AddedContent.pm   |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list