Action trigger fails if granularity is removed

Bug #2026206 reported by Terran McCanna
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
High
Unassigned

Bug Description

Evergreen 3.10-ish

If an action trigger is saved with a granularity setting and then the granularity is removed, it saves it as an empty string instead of NULL, but the query generated by action_trigger_runner.pl explicitly looks for NULL:

SELECT "atev".id FROM action_trigger.event AS "atev" INNER JOIN action_trigger.event_definition AS "atevdef" ON ( "atevdef".id = "atev".event_def ) WHERE "atev".run_time < 'now' AND "atev".state = 'pending' AND ( "atevdef".granularity IS NULL );

This results in events being created but getting stuck in Pending status and never completing.

Changed in evergreen:
assignee: nobody → Mike Rylander (mrylander)
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Mike Rylander (mrylander) wrote :

I've pushed a branch to working that addresses the "was NULL, now blank or all WS" granularity values by having the "get me events to work on" code understand that case in the one code path where we're looking for explicitly (and only) NULL granularity. See the top commit of:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/lp-2026206-empty-granularity

Revision history for this message
Mike Rylander (mrylander) wrote :

Note: It would be great if, instead, we enhanced the FM Editor to have a "NULL-ify this field" option for fields that can be NULL. That will require more work in the IDL to make sure NULLABLE fields marked correctly, and we'd probably want the fix offered here anyway, as extra/"real-world data" protection.

Changed in evergreen:
assignee: Mike Rylander (mrylander) → nobody
importance: Undecided → High
milestone: none → 3.next
Michele Morgan (mmorgan)
tags: added: pullrequest
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Mike and Terran! The patch looks good, but I wasn't sure how best to exercise it. Is there an a/t event definition in the concerto data set that you'd recommend trying this out on?

Revision history for this message
Terran McCanna (tmccanna) wrote :

Thanks Mike and Jane!

Something like the Fine Limit Exceeded action trigger should be easy to trigger.

1 - Make sure outgoing email is enabled on a test server.
2 - Enable the Fine Limit Exceeded action trigger (do not add granularity yet).
3 - Add your email address to a patron account.
4 - Add a large bill to the patron account.
5 - Verify that email comes through.
6 - Void bill on patron account.
7 - Add granularity to the Fine Limit Exceeded action trigger.
8 - Repeat steps 4-6.
9 - Remove granularity.
10 - Repeat steps 4-6.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.