Hello,

In the hook_cron_queue_info there is the 'worker callback' property. As it points out it should get a callback:
Valid callbacks in PHP:
'function_name'
array('class_name', 'static_method_name')
array($instance, 'instance_method_name')
function(...) use (...){...}

Even if we discard the last one as it is introduced in PHP from 5.3, the rest 3 are valid callbacks in 5.2.
As it is implemented currently it will accept only the first one - function_name.
The same is also in the management of batch 'finish' callback and probably other callbacks handling functions.

Is there good reason for the current state of the code?
Upload initial patch to target the problems shortly.

Comments

ndobromirov’s picture

Status: Needs work » Needs review
StatusFileSize
new1.09 KB

Here is the patch that adds call_user_func / call_user_func_array in the cron worker call and batch finish call.
Any comments and thoughts are welcome.

dcam’s picture

There is duplication of work between this issue and #2309539: Inconsistency in callback processing. The patches should be merged and one of the issues should be closed. Normally, the newer issue (the other one) is the one that should be closed.

claudiu.cristea’s picture

Status: Needs review » Closed (duplicate)