[open-ils-commits] [GIT] Evergreen ILS branch master updated. 6f8216512853b3d705bea46b3e362fc83d996bb1

Evergreen Git git at git.evergreen-ils.org
Mon Feb 1 02:13:46 EST 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, master has been updated
       via  6f8216512853b3d705bea46b3e362fc83d996bb1 (commit)
      from  da50743460e966dbbb07e1a19849905adafe7813 (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 6f8216512853b3d705bea46b3e362fc83d996bb1
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Tue Dec 22 09:11:55 2015 -0500

    LP#1528596: Add another eval/warning check in marc_export.
    
    This one checks if the $marc->insert_grouped_field for adding items
    throws an error or warning.  This happened on my records with a bad
    field that somehow made it through the conversion from XML.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/src/support-scripts/marc_export.in b/Open-ILS/src/support-scripts/marc_export.in
index f894e57..6e0face 100755
--- a/Open-ILS/src/support-scripts/marc_export.in
+++ b/Open-ILS/src/support-scripts/marc_export.in
@@ -470,7 +470,13 @@ sub next {
                         next unless ($acp);
                         my $location = $Marque::config->option_value('location');
                         my $price = ($acp->price() ? $Marque::config->option_value('money').$acp->price() : '');
-                        $marc->insert_grouped_field(
+                        eval {
+                            local $SIG{__WARN__} = sub {
+                                my $message = "Warning from bibliographic record " . $r->id() . ": "
+                                    . shift;
+                                warn($message);
+                            };
+                            $marc->insert_grouped_field(
                             MARC::Field->new(
                                 '852', '4', ' ',
                                 ($location ? ('a' => $location) : ()),
@@ -487,6 +493,12 @@ sub next {
                                 (!$U->is_true($acp->circulate()) ? (x => 'noncirculating') : ()),
                                 (!$U->is_true($acp->opac_visible()) ? (x => 'hidden') : ())
                             ));
+                        };
+                        if ($@) {
+                            warn("Error in bibliographic record " . $r->id() . ": $@");
+                            import MARC::File::XML; # Reset SAX Parser.
+                            return $self->next();
+                        }
                     }
                 }
                 if ($Marque::config->option_value('mfhd')) {

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

Summary of changes:
 Open-ILS/src/support-scripts/marc_export.in |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list