From 2eca0d6621a8c86d82eadc1b81442c4eb45f242d Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 29 Mar 2010 20:36:12 +0000 Subject: [PATCH] the reason I wanted to pass in an editor here, so I could flesh the users for their home_ou's needed for the event git-svn-id: svn://svn.open-ils.org/ILS/trunk@16044 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm index b5ab89b50e..a08dc09a82 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm @@ -2717,8 +2717,15 @@ sub create_user_request_events { my $ses = OpenSRF::AppSession->create('open-ils.trigger'); $ses->connect; + my %cached_usr_home_ou = (); for my $user_req (@$user_reqs) { - my $req = $ses->request('open-ils.trigger.event.autocreate', $hook, $user_req, $user_req->usr->home_ou); + my $home_ou = $cached_usr_home_ou{$user_req->usr}; + if (! $home_ou) { + my $user = $e->retrieve_actor_user($user_req->usr) or return $e->die_event; + $home_ou = $user->home_ou; + $cached_usr_home_ou{$user_req->usr} = $home_ou; + } + my $req = $ses->request('open-ils.trigger.event.autocreate', $hook, $user_req, $home_ou); $req->recv; } -- 2.11.0