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

Evergreen Git git at git.evergreen-ils.org
Mon Jan 9 14:07:39 EST 2012


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  d4a2d2cd5ea5e42d2be6480c5507a22a7ee83ab8 (commit)
      from  663317194fcf77ef584634adc543d050457821ac (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 d4a2d2cd5ea5e42d2be6480c5507a22a7ee83ab8
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Thu Jan 5 18:39:07 2012 -0500

    A/T Event Revalidation shouldn't change event states from complete to found
    
    Ideally, revalidation should be guaranteed not to change anything about
    the event itself at the database level, but I'm not sure we're there
    yet.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
index ffb45b7..2f28416 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
@@ -605,7 +605,7 @@ sub revalidate_event_group_test {
     my $client = shift;
     my $events = shift;
 
-    my $e = OpenILS::Application::Trigger::EventGroup->new(@$events);
+    my $e = OpenILS::Application::Trigger::EventGroup->new_nochanges(@$events);
 
     my $result = $e->revalidate_test;
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm
index 3e98ad7..1aca73e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm
@@ -14,6 +14,7 @@ sub new {
     my $class = shift;
     my $id = shift;
     my $editor = shift;
+    my $nochanges = shift; # no guarantees, yet...
     $class = ref($class) || $class;
 
     my $standalone = $editor ? 0 : 1;
@@ -27,7 +28,7 @@ sub new {
         return $id;
     }
 
-    my $self = bless { id => $id, editor => $editor, standalone => $standalone } => $class;
+    my $self = bless { id => $id, editor => $editor, standalone => $standalone, nochanges => $nochanges } => $class;
 
     return $self->init()
 }
@@ -93,8 +94,9 @@ sub init {
         $self->cleanedup(0);
     }
 
-
-    $self->update_state('found') || die 'Unable to update event state';
+    unless ($self->nochanges) {
+        $self->update_state('found') || die 'Unable to update event state';
+    }
 
     my $class = $self->_fm_class_by_hint( $self->event->event_def->hook->core_type );
     
@@ -112,8 +114,8 @@ sub init {
         $self->editor->xact_rollback || return undef;
     }
 
-    unless($self->target) {
-        $self->update_state('invalid');
+    unless ($self->target) {
+        $self->update_state('invalid') unless $self->nochanges;
         $self->valid(0);
     }
 
@@ -325,6 +327,16 @@ sub editor {
     return $self->{editor};
 }
 
+sub nochanges {
+    # no guarantees, yet.
+    my $self = shift;
+    return undef unless (ref $self);
+
+    my $e = shift;
+    $self->{nochanges} = $e if (defined $e);
+    return $self->{nochanges};
+}
+
 sub unfind {
     my $self = shift;
     return undef unless (ref $self);
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/EventGroup.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/EventGroup.pm
index 5703854..08adc5c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/EventGroup.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/EventGroup.pm
@@ -12,9 +12,11 @@ use OpenILS::Application::Trigger::ModRunner;
 
 my $log = 'OpenSRF::Utils::Logger';
 
-sub new {
+sub new_impl {
     my $class = shift;
-    my @ids = @_;
+    my @ids = @{shift()};
+    my $nochanges = shift;
+
     $class = ref($class) || $class;
 
     my $editor = new_editor(xact=>1);
@@ -25,7 +27,7 @@ sub new {
             map {
                 ref($_) ?
                     do { $_->standalone(0); $_->editor($editor); $_ } :
-                    OpenILS::Application::Trigger::Event->new($_, $editor)
+                    OpenILS::Application::Trigger::Event->new($_, $editor, $nochanges)
             } @ids
         ],
         ids         => [ map { ref($_) ? $_->id : $_ } @ids ],
@@ -39,6 +41,20 @@ sub new {
     return $self;
 }
 
+sub new_nochanges {
+    my $class = shift;
+    my @ids = @_;
+
+    return new_impl($class, \@ids, 1);
+}
+
+sub new {
+    my $class = shift;
+    my @ids = @_;
+
+    return new_impl($class, \@ids);
+}
+
 sub react {
     my $self = shift;
 

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Trigger.pm    |    2 +-
 .../lib/OpenILS/Application/Trigger/Event.pm       |   22 +++++++++++++++----
 .../lib/OpenILS/Application/Trigger/EventGroup.pm  |   22 +++++++++++++++++--
 3 files changed, 37 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list