for consistency, also flesh the copy in the resulting circ/hold objects
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 21:25:06 +0000 (21:25 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 21:25:06 +0000 (21:25 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14872 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm

index 5ee73ba..befdb1e 100644 (file)
@@ -3437,6 +3437,8 @@ sub copy_events {
 
     (my $obj_type = $self->api_name) =~ s/.*\.([a-z]+)$/$1/;
 
+    my $copy = $e->retrieve_asset_copy($copy_id) or return $e->event;
+
     my $copy_field = 'target_copy';
     $copy_field = 'current_copy' if $obj_type eq 'ahr';
 
@@ -3447,6 +3449,7 @@ sub copy_events {
         where => {$copy_field => $copy_id}
     };
 
+
     my $ses = OpenSRF::AppSession->create('open-ils.trigger');
     my $req = $ses->request('open-ils.trigger.events_by_target', 
         $obj_type, $filters, {atevdef => ['reactor', 'validator']}, 2);
@@ -3460,6 +3463,8 @@ sub copy_events {
             return $e->event unless $e->allowed('VIEW_USER', $user->home_ou);
         }
 
+        $tgt->$copy_field($copy);
+
         $tgt->usr($user);
         $conn->respond($val) if $val;
     }