From 9636eab1103b69b52d276ea6884bed3b8d549dee Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Sat, 28 Jan 2017 13:19:29 -0500 Subject: [PATCH] LP#1660059 - Allow for undef value for A/T Processing Group Context Field For an action_trigger.event_definition that uses action.hold_request.sms_notify as the Processing Group Context Field/group_field, the event processing shows multiple Perl warnings and the open-ils.trigger process dies. Tracing this to the relevant code in Trigger.pm shows that there is a check to make sure that the fieldmapper object actually exists ($node), but then assumes that the $ident_value (the actual field) is defined/not null. Adding an additional check fixes the problem. Signed-off-by: Chris Sharp --- Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm index 920175b5c7..c5bc93e90a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm @@ -777,6 +777,9 @@ sub grouped_events { # get the grouping value for the grouping object on this event my $ident_value = $node->$group_field(); + unless($ident_value) { # this can legitimately be undef, so we need to handle it if so + $e->update_state('invalid'); + } if(ref $ident_value) { my $ident_field = $ident_value->Identity; $ident_value = $ident_value->$ident_field() -- 2.11.0