System → Manage → Scheduled Tasks and create (or edit) any task.091#__scheduler_tasks.cron_rules for this row.6.1
cron_rules.exp stores 0 9 1 * * (with * wildcards for months and days_week since all options are selected). The task runs on the 1st of each month only.
cron_rules.exp stores 0 9 1 * 1,2,3,4,5,6,7. Because POSIX cron combines DOM and DOW with OR when both are restricted (non-wildcard), and DOW 1-7 evaluates as "every day of the week", the task runs every day at 09:00 instead of only the 1st.
dragonmantank/cron-expression (bundled)File: administrator/components/com_scheduler/src/Model/TaskModel.php, line 712 (Joomla 6.x):
$buildExpression .= ' ' . $this->wildcardIfMatch($matches['days_week'], range(0, 6), true);The UI (administrator/components/com_scheduler/src/Field/CronField.php → OPTIONS_RANGE['days_week'] = [1, 7]) posts day-of-week values in the range 1..7 (Monday=1 to Sunday=7). The normalization call compares against range(0, 6) → the diff is never empty, so wildcardIfMatch never replaces the enumerated list with *. This is an off-by-one mismatch between UI input and normalization reference.
Impact: any task that restricts days_month will always behave as if it has no day-of-month restriction, because days_week is always a restricted enumeration.
Change line 712 from range(0, 6) to range(1, 7) to match the UI values.
Alternatively, make wildcardIfMatch tolerant to both 0-based and 1-based representations of Sunday, since POSIX cron accepts both 0 and 7 for Sunday.
Manually patch cron_rules.exp in the DB after saving the task:
UPDATE #__scheduler_tasks
SET cron_rules = JSON_OBJECT('type', 'cron-expression', 'exp', '0 9 1 * *')
WHERE id = <task_id>;Note: re-editing the task through the UI will overwrite this fix.
| Labels |
Added:
bug
|
||
| Labels |
Added:
No Code Attached Yet
|
||