[open-ils-commits] [GIT] Evergreen ILS branch master updated. 4a0c30d4914d740bd8e2464706b149724bb6efdc

Evergreen Git git at git.evergreen-ils.org
Thu Oct 27 09:23:12 EDT 2011


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  4a0c30d4914d740bd8e2464706b149724bb6efdc (commit)
      from  2a77078c43bec6aab61c75a03f4801fe735cff58 (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 4a0c30d4914d740bd8e2464706b149724bb6efdc
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Fri Aug 26 16:19:13 2011 -0400

    SIP2 Checkout "no-code" failure fix
    
    Instead of assuming that code exists on a response do more checks.
    
    Specifically, a response code can be empty but not zero when there is no
    defined event code for the failure code.
    
    An easily tested case of this is standing penalties.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm
index bcfdc3b..ab8d17a 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm
@@ -91,27 +91,27 @@ sub do_checkout {
 
         syslog('LOG_DEBUG', "OILS: $method returned event: " . OpenSRF::Utils::JSON->perl2JSON($resp));
 
-        if (@$resp > 1 || $U->event_code($$resp[0])) {
+        my $first_code = $U->event_code($$resp[0]);
+        if (@$resp > 1 || !defined $first_code || $first_code ne '0') {
             # We got one or more non-success events
             $self->screen_msg('');
             for my $r (@$resp) {
-                if ( my $code = $U->event_code($r) ) {
-                    my $txt = $r->{textcode};
-                    syslog('LOG_INFO', "OILS: $method failed with event $code : $txt");
-
-                    if ($override_events{$txt} && $method !~ /override$/) {
-                        # Found an event we've been configured to override.
-                        $override = 1;
-                    } elsif ($txt =~ /ITEM_(?:DEPOSIT|RENTAL)_FEE_REQUIRED/ && $self->fee_ack) {
-                        # Patron acknowledged the fee.
-                        $override = 1;
-                    } elsif ( $txt eq 'OPEN_CIRCULATION_EXISTS' ) {
-                        $self->screen_msg(OILS_SIP_MSG_CIRC_EXISTS);
-                        return 0;
-                    } else {
-                        $self->screen_msg(OILS_SIP_MSG_CIRC_PERMIT_FAILED);
-                        return 0;
-                    }
+                my $code = $U->event_code($r);
+                my $txt = $r->{textcode};
+                syslog('LOG_INFO', "OILS: $method failed with event $code : $txt");
+
+                if ($override_events{$txt} && $method !~ /override$/) {
+                    # Found an event we've been configured to override.
+                    $override = 1;
+                } elsif ($txt =~ /ITEM_(?:DEPOSIT|RENTAL)_FEE_REQUIRED/ && $self->fee_ack) {
+                    # Patron acknowledged the fee.
+                    $override = 1;
+                } elsif ( $txt eq 'OPEN_CIRCULATION_EXISTS' ) {
+                    $self->screen_msg(OILS_SIP_MSG_CIRC_EXISTS);
+                    return 0;
+                } else {
+                    $self->screen_msg(OILS_SIP_MSG_CIRC_PERMIT_FAILED);
+                    return 0;
                 }
             }
             # This looks potentially dangerous, but we shouldn't

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

Summary of changes:
 .../lib/OpenILS/SIP/Transaction/Checkout.pm        |   36 ++++++++++----------
 1 files changed, 18 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list