Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
when running cron job using drush i noticed that disabled jobs also have been run
It seems a problem in `ultimate_cron/src/Entity/CronJob.php`
public function isScheduled() {
\Drupal::moduleHandler()->invokeAll('cron_pre_schedule', array($this));
$result = empty($this->disabled) && !$this->isLocked() && $this->getPlugin('scheduler')
->isScheduled($this);
\Drupal::moduleHandler()->invokeAll('cron_post_schedule', array($this));
return $result;
}
`$this->disabled` is not defined and `empty` always `TRUE`
Suggest to change to `empty($this->disabled)` to $this->status()
$result = $this->status() && !$this->isLocked() && $this->getPlugin('scheduler')->isScheduled($this);
Comment | File | Size | Author |
---|---|---|---|
#2 | ultimate_cron-3049883.patch | 666 bytes | amme |
|
Comments
Comment #2
amme CreditAttribution: amme commentedComment #3
amme CreditAttribution: amme commentedComment #4
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedThis looks good to me, and patch is simple enough.
Comment #5
BerdirPatches are much more likely to get committed with tests that verify that things are now working as expected. But thanks, committed now.