<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When creating an expression as a workflow task a user can easily create an invalid expression e.g. "cf_809sub_days(datefield, noofdays)" (real example)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>No errors are displayed when such an invalid expression is created, Also no errors are thrown when such an expression is evaluated when the workflow runs. We simply get a WSOD.<o:p></o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Ideally this error would be trapped when the task is created rather than when it is run, unfortunately users are not developers and do not recognise this type of syntax error.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'><o:p> </o:p></span></p><p class=MsoNormal>To at least help a little bit. the following code can be inserted into <o:p></o:p></p><p class=MsoNormal>modules\com_vtiger_workflow\expression_engine\VTExpressionEvaluater.inc<o:p></o:p></p><p class=MsoNormal>at around line 250<o:p></o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> $params = array_map(array($this, 'exec'), $expr->getParams());<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> $func = $this->operations[$op->value];<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> if (!$func || !function_exists($func)){<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> throw new Exception("Function [{$func}] does not exist in VTFieldExpressionEvaluater::exec");<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> return $func($params);</span><span style='font-family:"Courier New";mso-fareast-language:EN-AU'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";mso-fareast-language:EN-AU'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>To test at task creation a dummy evaluator could be run to see if it fails or not.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Chris</span><span style='color:#1F497D;mso-fareast-language:EN-AU'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>