Problems with TraceableEventDispatcher (not compatible with 10.3)

Created on 15 April 2024, 7 months ago
Updated 10 May 2024, 7 months ago

Problem/Motivation

With D11 / D10.3

While testing Add support for WebProfiler Needs work .

Return type

Fatal error: Declaration of Drupal\tracer\EventDispatcher\TraceableEventDispatcher::addListener($event_name, $listener, $priority = 0) must be compatible with Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::addListener($event_name, $listener, $priority = 0): void in /data/app/modules/contrib/tracer/src/EventDispatcher/TraceableEventDispatcher.php on line 62

PHP fatal: \Drupal\tracer\EventDispatcher\TraceableEventDispatcher::addListener needs to add a return type since 📌 [11.x] Add void returns for Symfony 7 RTBC

Service class replaced

\Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher is replaced by \Symfony\Component\EventDispatcher\EventDispatcher. Since 📌 Replace ContainerAwareEventDispatcher with Symfony EventDispatcher Fixed

So this service needs to extend, or if possible decorate the original instead. So it always has the correct arguments.

Dependency injection (may ignore per above)

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Drupal\tracer\EventDispatcher\TraceableEventDispatcher::__construct(), 0 passed in /data/app/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and at least 1 expected in /data/app/modules/contrib/tracer/src/EventDispatcher/TraceableEventDispatcher.php:49

The core service event_dispatcher no longer has any arguments, since 📌 Replace ContainerAwareEventDispatcher with Symfony EventDispatcher Fixed

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇦🇺Australia dpi Perth, Australia

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

Comments & Activities

Production build 0.71.5 2024