vTiger CRM 5.1.0 / PHP 5.3 and workflow module problem

2 11 2009

This is just a note in case anybody else has this problem as it was non-trivial to debug… and without prior knowledge of the changes in PHP 5.3 it might be hard to find.

Long story short:
vTiger workflow module fails when editing a workflow by popping up an alert box saying “Failure:undefined”

The code that produces the error is around lines 100-110 in <<VTIGERHOME>>/modules/com_vtiger_workflow/resources/editworkflowscript.js

This is due to the AJAX call to vTigers internal REST service failing because it can’t find everything it needs in php’s $_REQUEST superglobal.
(and thus produces an authentication failure exception).

The error occurs in the following file:
<<VTIGERHOME>>/webservice.php

The code assumes $_COOKIE information is in the $_REQUEST variable (which it is prior to PHP 5.3).

The fix:
Simply set the following php.ini directive to the following to emulate the pre php 5.3 behaviour…
request_order = “GPC”

GPC stands for GET POST COOKIE
Read more about the new directive here: http://php.net/manual/en/ini.core.php

Seeing as that setting is related to php security coding best practices we may just look at enabling it on a per vhost basis if going to production with vtiger on php 5.3
(do this at your own risk though!!)

Here is a very good post in relation to the setting change:
http://www.techworld.com.au/article/263089/upcoming_php_5_3_beefs_up_security