LP#1517556 - Exclude inactive event defs from find_event_def_by_hook. user/stompro/lp1517556_exclude_inactive_defs_find_by_hook
authorJosh Stompro <stomproj@larl.org>
Wed, 30 Mar 2016 13:47:57 +0000 (08:47 -0500)
committerJosh Stompro <stomproj@larl.org>
Wed, 30 Mar 2016 14:19:58 +0000 (09:19 -0500)
commit0c9c3034eeab42b3c65971e287cd83f646151b66
tree10da2e4d3aca8a1c745e016928edb3708fb2c2a9
parenteadd9458856920bf4e2a6972e5b572a7fae69b57
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 <stomproj@larl.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm