Fix in-transit hold retarget
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 13 Jun 2012 14:12:05 +0000 (10:12 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 13 Jun 2012 14:43:57 +0000 (10:43 -0400)
Tell the abort transit function to not commit our editor on us, basically.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Transit.pm

index 6e4f2b8..6132846 100644 (file)
@@ -1866,7 +1866,7 @@ sub _reset_hold {
                                my $trans = $e->retrieve_action_transit_copy($transid);
                                if( $trans ) {
                                        $logger->info("Aborting transit [$transid] on hold [$hid] reset...");
-                                       my $evt = OpenILS::Application::Circ::Transit::__abort_transit($e, $trans, $copy, 1);
+                                       my $evt = OpenILS::Application::Circ::Transit::__abort_transit($e, $trans, $copy, 1, 1);
                                        $logger->info("Transit abort completed with result $evt");
                                        unless ("$evt" eq 1) {
                         $e->rollback;
index 428afed..31e2a95 100644 (file)
@@ -221,7 +221,7 @@ sub abort_transit {
 
 sub __abort_transit {
 
-       my( $e, $transit, $copy, $no_reset_hold ) = @_;
+       my( $e, $transit, $copy, $no_reset_hold, $no_commit ) = @_;
 
        my $evt;
        my $hold;
@@ -253,7 +253,7 @@ sub __abort_transit {
        return $e->die_event unless $e->delete_action_transit_copy($transit);
        return $e->die_event unless $e->update_asset_copy($copy);
 
-       $e->commit;
+       $e->commit unless $no_commit;
 
        # if this is a hold transit, un-capture/un-target the hold
        if($holdtransit and !$no_reset_hold) {