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

Evergreen Git git at git.evergreen-ils.org
Thu Mar 29 13:19:55 EDT 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  9982302a1c8007876bfb98642c9e1dc5d2165b40 (commit)
      from  22445e14c338a90fc6f957f2c93f00b628ffaa1b (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 9982302a1c8007876bfb98642c9e1dc5d2165b40
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Mar 28 15:44:44 2012 -0400

    Hold targeter cancellation action/trigger repairs
    
    When a hold/reservation is cancelled via the targeter and passed off to
    action/trigger for possible event creation, ensure that all fields on
    the hold are in sync w/ the master db before the hand-off.  Otherwise,
    critical values, like cancel_time may be null, which can cause A/T
    event creation to fail.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
index cc61ba4..0f36c83 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
@@ -1138,10 +1138,13 @@ sub new_hold_copy_targeter {
 
 					# cancel cause = un-targeted expiration
 					$hold->update( { cancel_time => 'now', cancel_cause => 1 } ); 
+
+					# refresh fields from the DB while still in the xact
+					my $fm_hold = $hold->to_fieldmapper; 
+
 					$self->method_lookup('open-ils.storage.transaction.commit')->run;
 
 					# tell A/T the hold was cancelled
-					my $fm_hold = $hold->to_fieldmapper;
 					my $ses = OpenSRF::AppSession->create('open-ils.trigger');
 					$ses->request('open-ils.trigger.event.autocreate', 
 						'hold_request.cancel.expire_no_target', $fm_hold, $fm_hold->pickup_lib);
@@ -1447,10 +1450,13 @@ sub new_hold_copy_targeter {
 
 						# cancel cause = un-targeted expiration
 						$hold->update( { cancel_time => 'now', cancel_cause => 1 } ); 
+
+						# refresh fields from the DB while still in the xact
+						my $fm_hold = $hold->to_fieldmapper; 
+
 						$self->method_lookup('open-ils.storage.transaction.commit')->run;
 
 						# tell A/T the hold was cancelled
-						my $fm_hold = $hold->to_fieldmapper;
 						my $ses = OpenSRF::AppSession->create('open-ils.trigger');
 						$ses->request('open-ils.trigger.event.autocreate', 
 							'hold_request.cancel.expire_no_target', $fm_hold, $fm_hold->pickup_lib);
@@ -1670,10 +1676,13 @@ sub reservation_targeter {
 
 				# cancel cause = un-targeted expiration
 				$bresv->update( { cancel_time => 'now' } ); 
+
+				# refresh fields from the DB while still in the xact
+				my $fm_bresv = $bresv->to_fieldmapper;
+
 				$self->method_lookup('open-ils.storage.transaction.commit')->run;
 
 				# tell A/T the reservation was cancelled
-				my $fm_bresv = $bresv->to_fieldmapper;
 				my $ses = OpenSRF::AppSession->create('open-ils.trigger');
 				$ses->request('open-ils.trigger.event.autocreate', 
 					'booking.reservation.cancel.expire_no_target', $fm_bresv, $fm_bresv->pickup_lib);

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

Summary of changes:
 .../Application/Storage/Publisher/action.pm        |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list