]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#850160 - Event Def Environment Fleshing Might Have Issue
authorJosh Stompro <stompro@stompro.org>
Tue, 25 Feb 2020 19:53:08 +0000 (13:53 -0600)
committerMike Rylander <mrylander@gmail.com>
Tue, 25 Feb 2020 22:54:50 +0000 (17:54 -0500)
commit3f7fffffe9625d7caf3865ec9b16c88715942efc
treec634e1b61ea25396436a762118d06f05fa73cd18
parent57fc137cf8073c8128e990f17a77dfc9792d98a2
LP#850160 - Event Def Environment Fleshing Might Have Issue

When the action trigger environment gets fleshed out, there is a bug
with how might_have relations are fleshed ever other time they are
evaluated.

The first time they are correctly evaluated, but then the next time the
same path gets evaluated, the object gets reset to the first value in
the object.

See https://bugs.launchpad.net/evergreen/+bug/850160 for testing notes.

The fix is to add an extra check to only grab the first element if the object is
an array.  If it isn't an array it means it has already been fleshed.

Testing notes:

One way to test this bug is by looking at the self check
receipt, hours of operations bug.
https://bugs.launchpad.net/evergreen/+bug/793627

By default, the self check receipt will fail for even numbers of items checked
out because the hours of operation doesn't get fleshed correctly.

With this change, the receipt should print for even and odd numbers of items.

Another test is to add user.money_summary to a lost/bill action trigger
event notification.  Before the fix, if you have an even number of items billec, the
user.money_summary gets set to the first object in that table, and for odd
numbers of items, user.money_summary.balanced_owed gets set correctly.

Signed-off-by: Josh Stompro <stompro@stompro.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm