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.
Drupal 8.1 recently switched to Composer 2.8 in #2611816: Update to symfony 2.8. In Symfony 2.8 the method getListenerPriority()
is called on event dispatchers, but the web profiler doesn't implement this, resulting in the following fatal error when the module is enabled:
Error: Call to undefined method Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::getListenerPriority() in vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php on line 107
Comment | File | Size | Author |
---|---|---|---|
#14 | fatal_error_enabling-2682343-14.patch | 710 bytes | lussoluca |
| |||
#9 | fatal_error_enabling-2682343-9.patch | 726 bytes | lussoluca |
| |||
#2 | 2682343-2.patch | 482 bytes | pfrenssen |
|
Comments
Comment #2
pfrenssenI'm not sure where to get the listener priority from, even though this method is called it is not included in the TraceableEventDispatcherInterface and because of this the documentation on how to use this is missing. This at least allows to enable the module again, and since we didn't report back a priority before this also doesn't regress anything.
Comment #3
lussolucaIMHO that method needs to be added to Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher, because in Symfony 3.0 it will be added to the EventDispatcherInterface:
https://github.com/symfony/symfony/pull/16301
Comment #4
pfrenssenThe bug that
getListenerPriority()
is missing from the interface is fixed in Symfony 3.0: Issue 16301: [EventDispatcher] add method getListenerPriority() to interface. I'm not sure what the policy on backporting is for the Symfony project though.Comment #5
Kgaut CreditAttribution: Kgaut commentedI can confirm that the patch #2 clear this issue.
Comment #6
pfrenssen@lussoluca, cross-posted :)
That looks indeed to be the case. I'll open an issue to address this. If I look at how Symfony deals with this, then it seems we will still need it here too. From
\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
:Comment #7
pfrenssenOk from comment #42 on the symfony 2.8 update issue #2611816-42: Update to symfony 2.8 it appears that core's implementation of ContainerAwareEventDispatcher has consciously omitted the implementation of
::getListenerPriority()
:Comment #8
pfrenssenComment #9
lussolucaWaiting for #2682373: Implement ContainerAwareEventDispatcher::getListenerPriority(), I'm going to commit this patch later today.
Comment #11
lussolucaCommitted and pushed to 8.x-1.x.
Comment #12
dianacastillo CreditAttribution: dianacastillo as a volunteer commentedWhen will this be merged into a non - dev release? thanks
Comment #13
Andre-BThis needs to be ported to 2.x as well.
Comment #14
lussolucaIn the latest version of Drupal core this is no longer required, so we can remove it.
Comment #15
lussolucaTraceableEventDispatcher has been heavily modified since then and this is no longer applicable/needed.