PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar hiteshm0
hiteshm0
13 Jun 2026

Pull Request resolves #47944

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

Summary of Changes

The "Running since" tooltip ( in Scheduled Tasks page) for a locked task was incorrectly attempting to format $item->last_execution instead of $item->locked. Because a task crashing on its first run has a NULL value for last_execution, passing it to the date formatter caused PHP to crash.
This PR swaps $item->last_execution with $item->locked which logically represents the start time of the current run and is guaranteed to not be NULL within that code block.

Testing Instructions

  1. Navigate to System -> Scheduled Tasks.
  2. Click New to create a new task , save and close without running it.
  3. Access your database manager and locate the newly created task in the #__scheduler_tasks table.
  4. Manually edit the row: Set the locked column to a valid datetime and ensure last_execution remains NULL.
  5. Return to the Joomla Administrator and refresh the Scheduled Tasks page.

Actual result BEFORE applying this Pull Request

The Scheduled Tasks list fails to load properly and displays an uncaught error message.

Expected result AFTER applying this Pull Request

The Scheduled Tasks list loads properly. The stuck task correctly displays the 'running man' icon, and hovering over it displays the accurate tooltip

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar hiteshm0 hiteshm0 - open - 13 Jun 2026
avatar hiteshm0 hiteshm0 - change - 13 Jun 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Jun 2026
Category Administration
avatar hiteshm0 hiteshm0 - change - 13 Jun 2026
The description was changed
avatar hiteshm0 hiteshm0 - edited - 13 Jun 2026
avatar hiteshm0 hiteshm0 - change - 13 Jun 2026
The description was changed
avatar hiteshm0 hiteshm0 - edited - 13 Jun 2026
avatar hiteshm0 hiteshm0 - change - 13 Jun 2026
The description was changed
avatar hiteshm0 hiteshm0 - edited - 13 Jun 2026
avatar hiteshm0
hiteshm0 - comment - 13 Jun 2026

went with this approach over adding a NULL check on item->last_execution as doing so would avoid the fatal error but would still display the wrong value for the Running Since tooltip.

avatar hiteshm0
hiteshm0 - comment - 13 Jun 2026

went with this approach over adding a NULL check on item->last_execution as doing so would avoid the fatal error but would still display the wrong value for the Running Since tooltip ( it would display 'Running Since -') as last_exection would be NULL, while item->locked is guranteed to be not NULL.

avatar alikon
alikon - comment - 17 Jun 2026

the same shouldn't be done here

<?php echo HTMLHelper::_('date.relative', $item->lastdate, Text::_('DATE_FORMAT_LC6')); ?>

and here

<?php echo HTMLHelper::_('date', $item->nextdate, Text::_('DATE_FORMAT_LC6')); ?>

avatar alikon
alikon - comment - 17 Jun 2026

the same shouldn't be done here

<?php echo HTMLHelper::_('date.relative', $item->lastdate, Text::_('DATE_FORMAT_LC6')); ?>

and here

<?php echo HTMLHelper::_('date', $item->nextdate, Text::_('DATE_FORMAT_LC6')); ?>

?

avatar hiteshm0
hiteshm0 - comment - 17 Jun 2026

@alikon you're right, i just tested and there is a similar bug ( that this PR is trying to fix in schedules tasks list) in the execution history page of scheduled tasks. And it happens for all tasks that are manually trigerred.
image
same similar change can be made to fix it ( added a NULL check before the function call ).

should that be done in this PR, or should i make a new one?

avatar QuyTon
QuyTon - comment - 17 Jun 2026

@hiteshm0 Same PR please.

avatar hiteshm0
hiteshm0 - comment - 17 Jun 2026

@QuyTon @alikon
Adding null check and replacing function call with '-' will look something like this:
image
Next Execution is only NULL when execution rule is set to 'Manual Execution'. So it perhaps better to replace with a long string that reads Manual?
image

avatar hiteshm0 hiteshm0 - change - 20 Jun 2026
Labels Added: PR-5.4-dev
avatar hiteshm0
hiteshm0 - comment - 20 Jun 2026

went with the simpler approach for now

Add a Comment

Login with GitHub to post a comment