administrator/components/com_scheduler/tmpl/tasks/default.phplocked IS NOT NULL and last_execution = NULL in the DBThe task list renders normally, showing - for the last run date.
Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime)
of type string is deprecated in libraries/src/Date/Date.php on line 96
The entire page crashes — the Scheduled Tasks list is completely inaccessible.
In tmpl/tasks/default.php, the $item->locked block passes $item->last_execution directly to HTMLHelper::_('date', ...) without a NULL check:
// No NULL guard — crashes when last_execution is NULL
'active_title' => Text::sprintf('COM_SCHEDULER_RUNNING_SINCE',
HTMLHelper::_('date', $item->last_execution, 'DATE_FORMAT_LC5')),Note: the other two date calls in the same file (last run date column, next run date column) already have proper NULL guards. Only the locked block is missing it.
Add a single NULL check before calling HTMLHelper::_('date', ...):
<?php if ($item->locked) : ?>
<?php $lockedSince = $item->last_execution ? HTMLHelper::_('date', $item->last_execution, 'DATE_FORMAT_LC5') : '-'; ?>
<?php echo HTMLHelper::_('jgrid.action', $i, 'unlock', ['enabled' => $canChange, 'prefix' => 'tasks.',
'active_class' => 'none fa fa-running border-dark text-body',
'inactive_class' => 'none fa fa-running', 'tip' => true, 'translate' => false,
'active_title' => Text::sprintf('COM_SCHEDULER_RUNNING_SINCE', $lockedSince),
'inactive_title' => Text::sprintf('COM_SCHEDULER_RUNNING_SINCE', $lockedSince),
]); ?>
<?php endif; ?>| Labels |
Added:
No Code Attached Yet
|
||
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-06-16 16:20:27 |
| Closed_By | ⇒ | QuyTon |
Please test PR 47951. Thanks.
Are you willing to provide a pull request ?