From: Jason Etheridge Date: Mon, 13 Jan 2020 17:38:53 +0000 (-0500) Subject: lp1859502 fix A/T ApplyPatronPenalty reactor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bade77f0ef0087735ca29cd7fa816fab69a29b8b;p=evergreen%2Ftadl.git lp1859502 fix A/T ApplyPatronPenalty reactor To test this, you could create the following A/T definition: Owning Library: CONS Name: test lp1859502 Hook: penalty.PATRON_EXCEEDS_FINES Enabled: True Processing Delay: 00:00:00 Processing Group Context Field: usr Reactor: ApplyPatronPenalty Validator: NOOP_TRUE Max Event Validity Delay: 1 day Template: test message with environment: Field Path: usr Label: user Field Path: usr.home_ou Label: context_org with event params: Parameter Name: standing_penalty Parameter Value: ALERT_NOTE Then bill a test patron for $100 and run something like: /openils/bin/action_trigger_runner.pl --osrf-config /openils/conf/opensrf_core.xml --run-pending Without the patch, you'll get something like this in osrfsys.log: ApplyPatronPenalty: missing parameters And no ALERT_NOTE penalty. With the patch you should see a "test message" alert note when reloading the patron. Signed-off-by: Jason Etheridge Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/ApplyPatronPenalty.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/ApplyPatronPenalty.pm index 33e624e595..cbe4a089cd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/ApplyPatronPenalty.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/ApplyPatronPenalty.pm @@ -33,8 +33,8 @@ sub handler { my $env = shift; my $pname = $$env{params}{standing_penalty}; - my $user = $$env{environment}{user}; - my $context_org = $$env{environment}{context_org}; + my $user = $$env{user}; + my $context_org = $$env{context_org}; unless($pname and ref $user and ref $context_org) { $logger->error("ApplyPatronPenalty: missing parameters"); @@ -56,7 +56,7 @@ sub handler { $context_org->id; # apply the penalty - my $penalty = Fieldmapper::actor::usr_standing_penalty->new; + my $penalty = Fieldmapper::actor::user_standing_penalty->new; $penalty->usr($user->id); $penalty->org_unit($context_org); $penalty->standing_penalty($ptype->id);