Hi
When visiting the Elysia Cron settings page, these errors show up:
Notice: Undefined index: rule in _elysia_cron_next_run() (line 32 of /PATH/sites/all/modules/elysia_cron/elysia_cron_scheduler.inc).
Notice: Undefined index: rule in _elysia_cron_next_run() (line 33 of /PATH/sites/all/modules/elysia_cron/elysia_cron_scheduler.inc).
And also an 'Invalid rule' entry in watchdog has been produced.
These messages are being caused when a channel row is encountered while processing the elysia_cron table as they don't have a 'rule' index specified in their $conf array.
This can be fixed by implementing a preliminary check to see if $conf['rule'] is set (line 33):
Original
if (!preg_match('/^([0-9*,\/-]+)[ ]+([0-9*,\/-]+)[ ]+([0-9*,\/-]+)[ ]+([0-9*,\/-]+)[ ]+([0-9*,\/-]+)$/', $conf['rule'], $rules)) {
elysia_cron_warning('Invalid rule found: %rule', array('%rule' => $conf['rule']));
return false;
}
Fixed:
if(!isset($conf['rule'])) {
return false;
}
elseif (!preg_match('/^([0-9*,\/-]+)[ ]+([0-9*,\/-]+)[ ]+([0-9*,\/-]+)[ ]+([0-9*,\/-]+)[ ]+([0-9*,\/-]+)$/', $conf['rule'], $rules)) {
elysia_cron_warning('Invalid rule found: %rule', array('%rule' => $conf['rule']));
return false;
}
Patch will follow.
- Propaganistas
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | elysia_cron-rule-error-1984890-1.patch | 751 bytes | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedPatch
Comment #2
gotheric commentedCommitted fix in dev version, thanks