From: erickson Date: Thu, 26 Oct 2006 13:58:21 +0000 (+0000) Subject: stripping success events if other events exist in the return set X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=31f104348db9259ef3eeb46bdc4a3d50a0682338;p=evergreen%2Fpines.git stripping success events if other events exist in the return set git-svn-id: svn://svn.open-ils.org/ILS/trunk@6514 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index f77b6bbac6..a862d2bad1 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -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; }