[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_6 updated. 5b391779a8bf412218aaf739df44f602100d45e0

Evergreen Git git at git.evergreen-ils.org
Thu Aug 7 11:08:29 EDT 2014


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_6 has been updated
       via  5b391779a8bf412218aaf739df44f602100d45e0 (commit)
       via  7ee76a847de48469da23a381b4f8d1aedbdbcc5e (commit)
      from  91c8bfc19f18aac4531b10d1cd87458e00b7dcec (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 5b391779a8bf412218aaf739df44f602100d45e0
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Wed Jul 9 16:34:26 2014 -0400

    LP#1302207 - Attempt to validate ISBNs in AddedContent.pm.
    
    When getting ISBNs from the database, they often contain extra stuff
    after the ISBN that sometimes causes problems for Business::ISBN.
    
    This commit attempts to resolve some of that by looking only for the
    part of the ISBN data that resembles an ISBN and using just that part.
    If the ISBN data doesn't look like an ISBN, then it is discarded.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
index 276dcc9..e2adf6d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
@@ -143,10 +143,19 @@ sub handler {
         my @upcs  = grep {$_->{tag} eq '024'} @$key_data;
 
         map {
-            my $isbn_obj = Business::ISBN->new($_->{value});
-            my $isbn_str;
-            $isbn_str = $isbn_obj->as_string([]) if defined($isbn_obj);
-            $_->{value} = $isbn_str;
+            # Attempt to validate the ISBN.
+            # strip out hyphens;
+            $_->{value} =~ s/-//g;
+            #pull out the first chunk that looks like an ISBN:
+            if ($_->{value} =~ /([0-9xX]{10}(?:[0-9xX]{3})?)/) {
+                $_->{value} = $1;
+                my $isbn_obj = Business::ISBN->new($_->{value});
+                my $isbn_str;
+                $isbn_str = $isbn_obj->as_string([]) if defined($isbn_obj);
+                $_->{value} = $isbn_str;
+            } else {
+                undef $_->{value};
+            }
             undef $_ if !defined($_->{value});
         } @isbns;
 

commit 7ee76a847de48469da23a381b4f8d1aedbdbcc5e
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Fri Apr 11 16:05:07 2014 -0400

    LP#1302207 - Order AddedContent identifiers
    
    When multiple exist coming out in a consistent order is preferred.
    
    In this case, use ID order.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
index e1c0bf0..276dcc9 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
@@ -224,7 +224,10 @@ sub get_rec_keys {
                     ]
                 }
             ]
-        }
+        },
+        order_by => [
+                { class => 'mfr', field => 'id' }
+            ]
     });
 }
 

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

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list