SiT! Bugs - SiT!
View Issue Details
0000350SiT!portalpublic2008-12-22 12:112009-08-16 14:39
paulh 
ivan 
normalminorhave not tried
closedfixed 
 
3.503.50 
0000350: Open incident via portal gives an eval error
On latest trunk svn if you open an incident via the portal you get the following error:

Parse error: syntax error, unexpected T_IS_EQUAL in /home/paul/sit/includes/triggers.inc.php(104) : eval()'d code on line 1

Seems to be after/during the running of TRIGGER_INCIDENT_CREATED
No tags attached.
related to 0000769resolved kieran Portal incident created trigger needed 
has duplicate 0000685closed  Customer Adding incidents 
child of 0000704resolved ivan Optional trigger parameters that are not provided can cause errors in trigger rules 
Issue History
2008-12-22 12:11paulhNew Issue
2008-12-23 09:49ivanNote Added: 0000372
2008-12-23 09:49ivanAssigned To => paulh
2008-12-23 09:49ivanStatusnew => feedback
2008-12-23 19:23paulhNote Added: 0000374
2008-12-23 19:23paulhAssigned Topaulh =>
2008-12-23 19:23paulhStatusfeedback => new
2008-12-24 17:16paulhNote Added: 0000384
2009-03-05 13:53ivanNote Added: 0000725
2009-03-05 13:53ivanStatusnew => feedback
2009-03-06 20:07paulhNote Added: 0000740
2009-03-06 20:07paulhStatusfeedback => new
2009-03-07 15:25ivanNote Added: 0000756
2009-03-07 15:25ivanStatusnew => confirmed
2009-03-07 15:25ivanTarget Version => 3.50
2009-03-23 19:59timfederwitzNote Added: 0000796
2009-05-08 17:33blowagieNote Added: 0001033
2009-05-14 19:31paulhNote Added: 0001052
2009-05-14 19:39paulhRelationship addedhas duplicate 0000685
2009-05-19 14:50ivanStatusconfirmed => assigned
2009-05-19 14:50ivanAssigned To => ivan
2009-05-19 16:48ivanNote Added: 0001078
2009-05-19 16:54ivanRelationship addedchild of 0000704
2009-06-13 14:04kieranNote Added: 0001207
2009-07-11 14:54kieranRelationship addedrelated to 0000769
2009-07-11 14:55kieranNote Added: 0001290
2009-07-11 14:55kieranStatusassigned => resolved
2009-07-11 14:55kieranFixed in Version => Current SVN
2009-07-11 14:55kieranResolutionopen => fixed
2009-07-11 14:57ivanRelationship addedrelated to 0000760
2009-07-11 14:58ivanRelationship deletedrelated to 0000760
2009-08-16 13:16ivanFixed in VersionCurrent SVN => 3.50
2009-08-16 14:39ivanNote Added: 0001664
2009-08-16 14:39ivanStatusresolved => closed

Notes
(0000372)
ivan   
2008-12-23 09:49   
Which version?

Is this with the default set of triggers? If not you'll need to say what your exact trigger settings are, including your trigger rule.
(0000374)
paulh   
2008-12-23 19:23   
Latest trunk (so 3.45) (as of last night) I've not touched the triggers so its the default set
(0000384)
paulh   
2008-12-24 17:16   
just wiped my db and created a new one and still get the error so definetly using latest set of triggers
(0000725)
ivan   
2009-03-05 13:53   
Is this still an issue with 3.45?
(0000740)
paulh   
2009-03-06 20:07   
Unfortunatly yes, the user error is slightly more friendly now though:

Application Warning [512]
Error in trigger rule for TRIGGER_INCIDENT_CREATED, check your trigger rules. in /home/paulh/sit/lib/triggers.inc.php @ line 110
Backtrace:
/home/paulh/sit/lib/triggers.inc.php @ line 110 trigger_error()
/home/paulh/sit/portal/add.php @ line 232 trigger()
(0000756)
ivan   
2009-03-07 15:25   
thanks
(0000796)
timfederwitz   
2009-03-23 19:59   
Could this be what's causing new incidents to never be automatically assigned to an available engineer? Or would that be a separate bug? Currently, on my brand new install, new incidents never get auto assigned.
(0001033)
blowagie   
2009-05-08 17:33   
You can solve this problem by changing line number 232 in portal/add.php

Replace:
trigger('TRIGGER_INCIDENT_CREATED', array('incidentid' => $incidentid));
with:
trigger('TRIGGER_INCIDENT_CREATED', array('incidentid' => $incidentid, 'sendemail' => 1));

If you don't, the eval fails because {sendemail} is removed (replaced by nothing).
You end up with "$value = == 1" instead of "$value = 1 == 1".
(0001052)
paulh   
2009-05-14 19:31   
Thanks for the feedback blowagie, I think this is because we have:

Rules: {sendemail} == 1.

On the trigger though sendemail isn't a required field according to the trigger definition perhaps it should be. Kieran/Ivan can you clarify?
(0001078)
ivan   
2009-05-19 16:48   
Thanks blowagie (again)!

Although this isn't a required parameter, parameters don't have default values at the moment, so it does end up blank as you point out. I'll log a seperate bug about this, we need to either provide defaults for some parameters or make the trigger rules a bit more intelligent.

Added your patch in trunk svn r5390
(0001207)
kieran   
2009-06-13 14:04   
This is the case that the trigger parameters (rather than rules) should be used, but there's no UI for it! In this case, you'd add {sendemail} == 0 to the parameter as you don't want to send an initial email if the user is logging it as a portal incident.
(0001290)
kieran   
2009-07-11 14:55   
Resolved by Ivan in svn trunk r5390. Bug for proper solution reported as 0000760.
(0001664)
ivan   
2009-08-16 14:39   
Released in 3.50rc1