Problem/Motivation

In Drupal 10, the @event_dispatcher service has changed classes. On a new site install on Drupal 10.3.x from configuration that enables scheduler, I get the error:

[error] TypeError: Drupal\scheduler\SchedulerManager::__construct(): Argument #6 ($eventDispatcher) must be of type Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher, Symfony\Component\EventDispatcher\EventDispatcher given in Drupal\scheduler\SchedulerManager->__construct()

Issue fork scheduler-3437739

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gcb created an issue. See original summary.

gcb’s picture

StatusFileSize
new1.08 KB
gcb’s picture

StatusFileSize
new1.29 KB

jrockowitz made their first commit to this issue’s fork.

jrockowitz’s picture

StatusFileSize
new1.57 KB

We should use the Symfony\Component\EventDispatcher\EventDispatcherInterface to maintain backward compatibility.

phenaproxima’s picture

Status: Active » Reviewed & tested by the community

I'm running into this on my project. Patch looks okay to me, and CI is passing, so I guess this is RTBC.

phenaproxima’s picture

Title: [error] TypeError: Drupal\scheduler\SchedulerManager::__construct(): Argument #6 ($eventDispatcher) must be of type Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher, Symfony\Component\EventDispatcher\EventDispatcher given in Drupal\schedule » SchedulerManager should take an EventDispatcherInterface object, not ContainerAwareEventDispatcher

Re-titling for clarity.

jonathan1055’s picture

Version: 2.0.1 » 2.x-dev
Status: Reviewed & tested by the community » Needs work

Hi gcb, jrockowitz and phenaproxima,
Thanks for working on this. But I am surprised at the issue summary "on a new site with Drupal 10.2.4 ..." is that really correct? Maybe you mean 10.3 or 11.x? Anyway, there is clearly something to fix here, so please can you open a Merge Request so that we can see the gitlab pipeline. Patch testing on drupal.org is being phased out, and all the development here should now be on MRs.
Thanks

phenaproxima’s picture

Status: Needs work » Reviewed & tested by the community

Hi @jonathan1055 - there is a merge request open and CI is passing. You can see this at the top of this issue. But, for reference...

The merge request: https://git.drupalcode.org/project/scheduler/-/merge_requests/128

The passing tests: https://git.drupalcode.org/issue/scheduler-3437739/-/pipelines/139271

I'm hiding the patches, though, for clarity.

phenaproxima’s picture

Issue summary: View changes
jonathan1055’s picture

Thanks. Sorry I don't know why I missed it. I have rebase the MR and running the pipeline again.

jonathan1055’s picture

In your previous test run, the phpunit tests are only run automatically at the current core version, 10.2 and they pass of course. But the "next minor" phpunit, for core 10.3, have to be triggered manually.

jonathan1055’s picture

The tests at 10.3 still have deprecations, but the actual tests run.

I need to verify if this change is OK at "previous minor" core 10.1 and "previous major" Core 9.5.11 before I commit.

I ran in to a problem with doing that, which I reported on #3441816: All variants run the same Drupal version when the pipeline is triggered via web. It seems that running a pipeline manually from the Web UI is not compatible with the Core variants.

jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed

All passed at previous versions
https://git.drupalcode.org/project/scheduler/-/pipelines/150255

Merged. Thank you for working on this. I will make a new release tomorrow.

jonathan1055’s picture

I have released Scheduler 2.0.2

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jonathan1055’s picture

Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.