From a05d872a17ee05cf003ee0aa024e9cc4d76b3cdc Mon Sep 17 00:00:00 2001 From: Josh Stompro Date: Wed, 30 Mar 2016 08:47:57 -0500 Subject: [PATCH] LP#1517556 - Exclude inactive event defs from find_event_def_by_hook. Currently when find_event_def_by_hook is called to find an appropriate event_def based on the hook, it doesn't exclude inactive event defs. So strange behavior can happen if inactive event defs are present. I ran into this issue when I was trying out different versions of the self check receipt event def. I had one ative and one inactive while I was troubleshooting, and when the system would grab the inactive event def by chance, the self check UI would freeze. I think it is a resonable expectation that an event def marked inactive doesn't get used by the system. To test this out, clone one of the self check event defs, such as "Self-Checkout Items Out Receipt" and mark the copy as inactive. Now go and trigger this event in the self check interface by attempting to print from the Items Out screen. It should now fail 50% of the time, since both the active and inactive defs are returned. After the fix the inactive event def will always be excluded, so the action should no longer fail. Signed-off-by: Josh Stompro Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index 5f4714b0ae..0fad7d97e7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -1672,7 +1672,7 @@ sub find_event_def_by_hook { for my $org_id (reverse @$orgs) { my $def = $e->search_action_trigger_event_definition( - {hook => $hook, owner => $org_id})->[0]; + {hook => $hook, owner => $org_id, active => 't'})->[0]; return $def if $def; } -- 2.43.2