Update scheduler SchedulerEvent namespace dependencies

Created on 24 May 2024, 7 months ago
Updated 29 May 2024, 7 months ago

Problem/Motivation

After updating the dependent Scheduler module, it looks like they have refactored how their code is organised and have updated namespaces.

When running the lightweight scheduler-cron, this error is produced:

Argument #1 ($event) must be of type Drupal\scheduler\SchedulerEvent, Drupal\scheduler\Event\SchedulerEvent given

Steps to reproduce

  • Prepare nodes to be published on schedule
  • Run lightweight scheduler-cron
  • Observe error in description

Proposed resolution

Update dependent use statements to correspond with refactored scheduler module.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom jonnyhocks

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonnyhocks
  • Status changed to Needs review 7 months ago
  • 🇬🇧United Kingdom jonnyhocks

    Here's a patch which updates the namespaces from the scheduler module.

  • Status changed to Needs work 7 months ago
  • 🇬🇧United Kingdom nicrodgers Monmouthshire, UK

    Thanks for the patch.

    Is it possible to do that patch so that it works with both versions of scheduler?

    If the patch fixes it with the latest version of scheduler, presumably it will break for people still using the previous version?
    So to avoid releasing a new major version of advanced_scheduler I was wondering whether it was possible to make it work with both.

    If not, we can roll this in to a new major version.

Production build 0.71.5 2024