CronRule::getLastSchedule() sets the wrong property ($last_ran instead of $last_run)

Created on 5 January 2023, almost 2 years ago
Updated 17 February 2024, 10 months ago

Viewing jobs shows the following exception, on PHP 8.2.

Deprecated function: Creation of dynamic property Drupal\ultimate_cron\CronRule::$last_ran is deprecated in Drupal\ultimate_cron\CronRule->getLastSchedule() (line 379 of modules/contrib/ultimate_cron/src/CronRule.php).

The error is caused by the code that is setting $this->last_ran instead of $this->last_run, which is the right class property.

In fact, the class properties are the following ones.

  public $rule = NULL;
  public $time = NULL;
  public $skew = 0;

  public $allow_shorthand = FALSE;
  private static $ranges = array(
    'minutes' => array(0, 59),
    'hours' => array(0, 23),
    'days' => array(1, 31),
    'months' => array(1, 12),
    'weekdays' => array(0, 6),
  );

  private $type = NULL;
  static private $cache = array();
  static private $instances = array();
  private $last_run;
  private $next_run;
  private $parsed;
📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇮Finland j-vee Turku, Finland

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024