RTC PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar n3t
n3t
23 Feb 2024

Summary of Changes

Avoid fatal PHP error on saving Task with incorrect user input.

Testing Instructions

Create new task in com_scheduler, select "Cron Expression (Advanced)" as "Execution Rule", do not choose any Minute, Hour, Day, Month or Day of Week in Cron Match section and save. Sames apply if you choose only some of these but not all.

Actual result BEFORE applying this Pull Request

PHP Error
Joomla\Component\Scheduler\Administrator\Model\TaskModel::wildcardIfMatch(): Argument #1 ($target) must be of type array, null given, called in ../administrator/components/com_scheduler/src/Model/TaskModel.php on line 637

Expected result AFTER applying this Pull Request

Warning is raised, task not saved. User can correct input and save again.

Additional info

Modified the Rule to reflect real cron expression rule type (it is not custom but cron-expression), plus added required for subsequent fields in validation.

Applies to Joomla 5 also.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar n3t n3t - open - 23 Feb 2024
avatar n3t n3t - change - 23 Feb 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Feb 2024
Category Administration
avatar n3t n3t - change - 23 Feb 2024
Title
Update ExecutionRulesRule to validate custom cron expression correctly
[4.4] com_scheduler - Update ExecutionRulesRule to validate custom cron expression correctly
avatar n3t n3t - edited - 23 Feb 2024
avatar Quy
Quy - comment - 23 Feb 2024

Alternative PR #37536 using JavaScript.

avatar brianteeman
brianteeman - comment - 23 Feb 2024

@Quy not an alternative but a required additional #37536 (comment)

avatar n3t
n3t - comment - 23 Feb 2024

Seems both these PR could live together, #37536 is client side JS solution, this PR is server side solution.

avatar fgsw
fgsw - comment - 24 Feb 2024

With PR only 3 fields are missing:

image

correct the missing fields 2 more fields are missing:

image

All missing fields should show at once.

avatar n3t
n3t - comment - 24 Feb 2024

This is Joomla standard, show only up to 3 errors and is caused directly by FormController. Doesn't have to do anything with this PR. I do not think we should override this behavior just for this use case...

avatar fgsw fgsw - test_item - 24 Feb 2024 - Tested successfully
avatar fgsw
fgsw - comment - 24 Feb 2024

I have tested this item ✅ successfully on 54e89cf

Thanks for explanation @n3t.


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

avatar viocassel viocassel - test_item - 24 Feb 2024 - Tested successfully
avatar viocassel
viocassel - comment - 24 Feb 2024

I have tested this item ✅ successfully on 54e89cf


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

avatar richard67 richard67 - change - 24 Feb 2024
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 24 Feb 2024

RTC


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

avatar n3t n3t - change - 28 Feb 2024
Labels Added: RTC PR-4.4-dev
avatar laoneo laoneo - change - 4 Mar 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-03-04 13:03:25
Closed_By laoneo
avatar laoneo laoneo - close - 4 Mar 2024
avatar laoneo laoneo - merge - 4 Mar 2024
avatar laoneo
laoneo - comment - 4 Mar 2024

Thanks!

Add a Comment

Login with GitHub to post a comment