added further sanity check to prevent db update errors
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Aug 2006 22:11:03 +0000 (22:11 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Aug 2006 22:11:03 +0000 (22:11 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5412 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 799e3f7..41f2b15 100644 (file)
@@ -1325,11 +1325,13 @@ sub attempt_checkin_hold_capture {
        $hold->current_copy($copy->id);
        $hold->capture_time('now');
 
-       # prevent some DB errors
+       # prevent DB errors caused by fetching 
+       # holds from storage, and updating through cstore
        $hold->clear_fulfillment_time;
        $hold->clear_fulfillment_staff;
        $hold->clear_fulfillment_lib;
        $hold->clear_expire_time; 
+       $hold->clear_cancel_time;
 
        $self->bail_on_events($self->editor->event)
                unless $self->editor->update_action_hold_request($hold);
@@ -1343,6 +1345,9 @@ sub attempt_checkin_hold_capture {
                # This hold was captured in the correct location
        $copy->status(OILS_COPY_STATUS_ON_HOLDS_SHELF);
                $self->push_events(OpenILS::Event->new('SUCCESS'));
+               my $evt = $holdcode->hold_email_notifify(
+                       $self->editor, $hold, $self->title, $self->volume, $self->copy );
+               $self->bail_on_events($evt) if $evt;
        
        } else {