[Vtigercrm-developers] Workflow task bugs

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Tue Sep 8 23:48:05 GMT 2015


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)

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.

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.

To at least help a little bit. the following code can be inserted into
modules\com_vtiger_workflow\expression_engine\VTExpressionEvaluater.inc
at around line 250

                     $params = array_map(array($this, 'exec'), $expr->getParams());
                     $func = $this->operations[$op->value];
                                if (!$func || !function_exists($func)){
                                    throw new Exception("Function [{$func}] does not exist in VTFieldExpressionEvaluater::exec");
                                }
                     return $func($params);


To test at task creation a dummy evaluator could be run to see if it fails or not.


Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150909/ca09e7ce/attachment-0001.html>


More information about the vtigercrm-developers mailing list