No Code Attached Yet
avatar Andypaper
Andypaper
11 Jun 2026

Environment

  • Joomla version: 6.1.1 (also reproducible on 5.x)
    • PHP version: 8.3
      • File: administrator/components/com_scheduler/tmpl/tasks/default.php

Steps to reproduce

  1. Install any task plugin and create a new task
    1. Trigger "Run Test" (or wait for automatic execution) while the task has never completed successfully — e.g. the task crashes immediately due to a missing dependency or network error
    1. The task remains with locked IS NOT NULL and last_execution = NULL in the DB
    1. Navigate to System → Scheduled Tasks

Expected result

The task list renders normally, showing - for the last run date.

Actual result

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.

Root cause

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.

Proposed fix

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; ?>
avatar Andypaper Andypaper - open - 11 Jun 2026
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jun 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Jun 2026
avatar alikon
alikon - comment - 12 Jun 2026

Are you willing to provide a pull request ?

avatar QuyTon QuyTon - change - 16 Jun 2026
Status New Closed
Closed_Date 0000-00-00 00:00:00 2026-06-16 16:20:27
Closed_By QuyTon
avatar QuyTon QuyTon - close - 16 Jun 2026
avatar QuyTon
QuyTon - comment - 16 Jun 2026

Please test PR 47951. Thanks.

avatar QuyTon
QuyTon - comment - 16 Jun 2026

Please test PR #47951. Thanks.

Add a Comment

Login with GitHub to post a comment