stripping success events if other events exist in the return set
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 26 Oct 2006 13:58:21 +0000 (13:58 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 26 Oct 2006 13:58:21 +0000 (13:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6514 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm

index f77b6bb..a862d2b 100644 (file)
@@ -192,9 +192,12 @@ sub run_method {
                # make sure no success event accidentally slip in
                $circulator->events(
                        [ grep { $_->{textcode} ne 'SUCCESS' } @{$circulator->events} ]);
+
+               # Log the events
                my @e = @{$circulator->events};
                push( @ee, $_->{textcode} ) for @e;
                $logger->info("circulator: bailing out with events: @ee");
+
                $circulator->editor->rollback;
 
        } else {
@@ -214,6 +217,8 @@ sub run_method {
 sub circ_events {
        my $circ = shift;
        my @e = @{$circ->events};
+       # if we have multiple events, SUCCESS should not be one of them;
+       @e = grep { $_->{textcode} ne 'SUCCESS' } @e if @e > 1;
        return (@e == 1) ? $e[0] : \@e;
 }