Closed (fixed)
Project:
Elysia Cron
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
3 Nov 2009 at 11:18 UTC
Updated:
9 Mar 2011 at 19:21 UTC
When defining a cron job via hook_cronapi as follows :
function mymodule_cronapi($op, $job = NULL) {
switch ($op) {
case 'list' :
return array(
'mymodule_index' => 'Some index routine'
);
break;
case 'rule' :
switch ($job) {
case 'mymodule_index' : return '15 1 * * *';
}
break;
case 'execute' :
switch ($job) {
case 'mymodule_index' :
mymodule_index_function();
break;
}
break;
}
}
and then try to run the routine via "admin/build/cron/status" i am getting sucessful job execution, but in logs there is a message "could not find a function".
After doing some research, i've found that
function elysia_cron_execute_page($job = false) {
global $cron_completed, $cron_executing_job;
if (!$job) {
drupal_set_message(t('No job specified'), 'error');
drupal_goto('admin/build/cron');
}
...
}
needs to have elysia_cron_initialize(); call, as follows:
function elysia_cron_execute_page($job = false) {
global $cron_completed, $cron_executing_job;
elysia_cron_initialize();
if (!$job) {
drupal_set_message(t('No job specified'), 'error');
drupal_goto('admin/build/cron');
}
...
}
After this everything started to work perfectly.
Comments
Comment #1
gotheric commentedHmm, interesting... i'll commit the fix soon!
Thanks for the report.
P.S. Just for information, you can use a more compact form of the declaration (avoiding the "case 'execute'"):
Comment #2
sbozhko commentedYep, i know. That was just the case when the bug comes up.
Comment #3
gotheric commentedCommited patch (and other fixes).
Comment #5
pcarman commentedI see your last module version release was in 2009. Looks like this patch was put in after the latest official copy of 1.2. Are you planning on putting out the updated version?
This is the exact fix I need for our site to test and make sure this module is set up correctly.
Comment #6
gotheric commentedI'm working on new relases right now (for D5, D6 & D7).
I've just relased a new NIGHLY release... i think you should wait some weeks for a new stable release.