Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.4
-
Fix Version/s: 4.5
-
Component/s: CiviContribute
-
Labels:
Description
The CiviCRM Financial component defines its REST functions in the page CRM_Financial_Page_Ajax.php.
These functions are then invoked through:
return call_user_func(array($params['className'], $params['fnName']), $params);
https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/REST.php#L331
This syntax assumes that the functions of the Ajax.php pages are static but most are not static even in the core file. Therefore we receive a notice:
"Strict warning: call_user_func() expects parameter 1 to be a valid callback, non-static method CRM_Financial_Page_AJAX::jqFinancialType() should not be called statically in CRM_Utils_REST::process() (line 329 of /var/www/myhost/sites/all/modules/civicrm/CRM/Utils/REST.php)."
It looks like the syntax should either be changed or the methods such as jqFinancialType should be declared static.
$class = new $params['className'];
return call_user_func(array($class, $params['fnName']), $params);