Updates Requested PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar devesht-ML
devesht-ML
28 Apr 2026

Fixes #47647

  • I read the Generative AI policy and my contribution is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

This PR fixes incorrect normalization of the days_of_week field in the Scheduler cron expression.

The UI provides day-of-week values in the range 1–7, but the normalization logic compares against an incorrect range. Because of this mismatch, when all weekdays are selected, the system fails to convert them into a wildcard (*) and instead stores a full list (1,2,3,4,5,6,7).

Due to POSIX cron semantics (OR condition between day-of-month and day-of-week), this causes tasks to run daily instead of only on the 1st of the month.

Fix

Updated normalization logic to use:

range(1, 7)

so that selecting all weekdays correctly results in *.


Testing Instructions

  1. Go to System → Manage → Scheduled Tasks
  2. Create a new task (e.g. "GET Request" or "Delete ActionLogs")
  3. Set Execution Rule → Custom cron expression
  4. Configure:
    • Minutes = 0
    • Hours = 9
    • Days of Month = 1
    • Months = all selected
    • Days of Week = all selected
  5. Save the task
  6. (Optional) Run the task manually
  7. Check Next Execution in the task list or Execution History

Actual result BEFORE applying this Pull Request

  • Cron expression stored internally as:
    0 9 1 * 1,2,3,4,5,6,7

  • Because both DOM and DOW are restricted, POSIX OR semantics apply

  • Task runs daily at 09:00

Example:
Next Execution: 2026-04-29 09:00


Expected result AFTER applying this Pull Request

  • Cron expression correctly normalized to:
    0 9 1 * *

  • Day-of-week is treated as wildcard (*)

  • Task runs only on the 1st of each month at 09:00

Example:
Next Execution: 2026-05-01 09:00


Screenshots

Before (Bug - Daily Execution)

![Before Screenshot]

before-fix-corn
  • The task is scheduled for the next day, indicating incorrect daily execution.

After (Fix Applied - Monthly Execution)

![After Screenshot/Video]

afterfix-corn.1.mp4
  • The task is correctly scheduled for the 1st of the next month.

Link to documentations

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar devesht-ML devesht-ML - open - 28 Apr 2026
avatar devesht-ML devesht-ML - change - 28 Apr 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Apr 2026
Category Administration
avatar devesht-ML devesht-ML - change - 28 Apr 2026
Title
Fix days_of_week normalization to match UI values (1–7)
Fix days_of_week normalization
avatar devesht-ML devesht-ML - edited - 28 Apr 2026
avatar richard67
richard67 - comment - 28 Apr 2026

According to the description of the linked issue it happens also with 5.4. if that is the case, this PR should be made for the 5.4-dev branch.

avatar brianteeman
brianteeman - comment - 28 Apr 2026

the syntax should follow the syntax for linux cron and nothing else

avatar devesht-ML devesht-ML - change - 28 Apr 2026
Labels Added: PR-6.1-dev
avatar devesht-ML
devesht-ML - comment - 28 Apr 2026

I've updated the implementation to normalize day-of-week values by mapping 7 → 0 before comparison.

This ensures that both representations (0–6 and 1–7) are handled correctly and wildcard detection works as expected while keeping Sunday portable.

Please let me know if you'd prefer this logic to be integrated into wildcardIfMatch instead.

avatar devesht-ML devesht-ML - change - 28 Apr 2026
The description was changed
avatar devesht-ML devesht-ML - edited - 28 Apr 2026
avatar cybersalt cybersalt - test_item - 30 Apr 2026 - Tested successfully
avatar cybersalt
cybersalt - comment - 30 Apr 2026

I have tested this item ✅ successfully on a39b118

After applying the patch and saving the task again the cron expression stored as {"type":"cron-expression","exp":"0 9 1 * *"}


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47708.

avatar cybersalt
cybersalt - comment - 30 Apr 2026

I have tested this item ✅ successfully on a39b118

After applying the patch and saving the task again the cron expression stored as {"type":"cron-expression","exp":"0 9 1 * *"}


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47708.

avatar ThomasFinnern ThomasFinnern - test_item - 1 May 2026 - Tested successfully
avatar ThomasFinnern
ThomasFinnern - comment - 1 May 2026

I have tested this item ✅ successfully on a39b118

Looked into table scheduler_tasks and have seen both result


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47708.

avatar ThomasFinnern
ThomasFinnern - comment - 1 May 2026

I have tested this item ✅ successfully on a39b118

Looked into table scheduler_tasks and have seen both result


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47708.

avatar richard67
richard67 - comment - 1 May 2026

Not setting RTC (ready to commit) despite of the 2 successful human tests because

  1. There is still a change requested by a reviewer, see #47708 (comment) .
  2. The issue happens also with Joomla 5.4 and is classified as bug, so the PR should be made for the 5.4-dev branch. See my previous comment above and https://github.com/joomla/joomla-cms#which-branch-should-my-pull-request-target .
avatar richard67 richard67 - change - 1 May 2026
Labels Added: Updates Requested
avatar richard67 richard67 - alter_testresult - 1 May 2026 - ThomasFinnern: Tested successfully
avatar richard67 richard67 - alter_testresult - 1 May 2026 - cybersalt: Tested successfully

Add a Comment

Login with GitHub to post a comment