SiT! Bugs - SiT!
View Issue Details
0000704SiT!triggerspublic2009-05-19 16:522013-05-04 17:56
ivan 
ivan 
normalminoralways
resolvedfixed 
3.45 
3.90beta1Current GIT 
0000704: Optional trigger parameters that are not provided can cause errors in trigger rules
If a trigger has parameters that are not required (i.e. Optional) and the trigger call does not provide values for those parameter and a trigger rule uses one of those same parameters an error can result because the {param} variable within the trigger rule will be replaced with an empty string leading to a rule like

=== TRUE

which is obviously invalid.
No tags attached.
parent of 0000350closed ivan Open incident via portal gives an eval error 
parent of 0000685closed  Customer Adding incidents 
child of 0001089confirmed  [META] triggers revamp 
Issue History
2009-05-19 16:52ivanNew Issue
2009-05-19 16:54ivanRelationship addedparent of 0000350
2009-05-19 16:56ivanRelationship addedparent of 0000685
2009-05-19 16:56ivanStatusnew => confirmed
2009-05-19 16:56ivanTarget Version => 3.50
2009-07-24 16:40kieranNote Added: 0001386
2009-07-24 16:40kieranAssigned To => kieran
2009-07-24 16:40kieranTarget Version3.50 => 3.60
2009-08-17 12:30kieranTarget Version3.60 => 3.80
2009-08-17 12:31kieranStatusconfirmed => assigned
2010-02-20 17:03paulhTarget Version3.60 LTS => 4.0
2010-02-20 17:04paulhRelationship addedchild of 0001089
2011-02-14 13:25ivanTarget Version4.0 => 3.90beta1
2012-11-03 14:50ivanAssigned Tokieran => ivan
2012-11-03 14:50ivanNote Added: 0004577
2013-05-04 16:36paulhNote Added: 0004815
2013-05-04 17:50paulhNote Added: 0004816
2013-05-04 17:56paulhStatusassigned => resolved
2013-05-04 17:56paulhResolutionopen => fixed
2013-05-04 17:56paulhFixed in Version => Current GIT

Notes
(0001386)
kieran   
2009-07-24 16:40   
Bumping to 3.60, it's not causing problems atm and should be solved by the new triggers UI.
(0004577)
ivan   
2012-11-03 14:50   
Review to see what the current status is.
(0004815)
paulh   
2013-05-04 16:36   
To reproduce this issue create a notification on incident created and enable a check for priority though don't enter a priority and you get the following error

2013-05-04T16:34:00+01:00 /sit4/incident_new.php Application Warning [512] Error in trigger rule for
                                TRIGGER_INCIDENT_CREATED, check your
                                <a href='triggers.php'>trigger rules</a>
ID: 43, rule: {incidentpriorityid}== (in line 317 of file /home/paulh/git/paulheaneys-sit/lib/trigger.class.php)


and in the apache logs


[Sat May 04 16:34:00 2013] [error] [client ::1] PHP Parse error: syntax error, unexpected ';' in /home/paulh/git/paulheaneys-sit/lib/trigger.class.php(310) : eval()'d code on line 1, referer: http://localhost/sit4/incident_new.php?action=incidentform&type=support&contactid=4&maintid=1&producttext=Example+Product&productid=1&updateid=0&siteid=1&win= [^]
[Sat May 04 16:34:00 2013] [error] [client ::1] PHP Stack trace:, referer: http://localhost/sit4/incident_new.php?action=incidentform&type=support&contactid=4&maintid=1&producttext=Example+Product&productid=1&updateid=0&siteid=1&win= [^]
[Sat May 04 16:34:00 2013] [error] [client ::1] PHP 1. {main}() /home/paulh/git/paulheaneys-sit/incident_new.php:0, referer: http://localhost/sit4/incident_new.php?action=incidentform&type=support&contactid=4&maintid=1&producttext=Example+Product&productid=1&updateid=0&siteid=1&win= [^]
[Sat May 04 16:34:00 2013] [error] [client ::1] PHP 2. TriggerEvent->TriggerEvent() /home/paulh/git/paulheaneys-sit/incident_new.php:893, referer: http://localhost/sit4/incident_new.php?action=incidentform&type=support&contactid=4&maintid=1&producttext=Example+Product&productid=1&updateid=0&siteid=1&win= [^]
[Sat May 04 16:34:00 2013] [error] [client ::1] PHP 3. Trigger->fire() /home/paulh/git/paulheaneys-sit/lib/trigger.class.php:53, referer: http://localhost/sit4/incident_new.php?action=incidentform&type=support&contactid=4&maintid=1&producttext=Example+Product&productid=1&updateid=0&siteid=1&win= [^]
(0004816)
paulh   
2013-05-04 17:50   
5232df37 adds check that optional parameters are filled in, don't think there is any point in checking the command before execution as its no different the running the command and getting the error (if we do need to check it won't be trivial)