- Issue created by @superfedya
- πΈπͺSweden mscweb
Experiencing the same issues on 11.1.0
As according to the error the issue stems from Drupal/Component/DependencyInjection/Container.php where definitions and arguments of the object with id "term_merge.term_merger" are resolved (as I understand it).
On line 237 in container.php the code
$arguments = $this->resolveServicesAndParameters($arguments);
resolves the service "event_dispatcher" to a Symfony\Component\EventDispatcher\EventDispatcher.Though in term_merge\src\TermMerger.php it is specified to use the Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher. However, ContainerAwareEventDispatcher was deprecated as of drupal 10.3.0 ( https://www.drupal.org/node/3376090 β ) in favor of Symfony\Component\EventDispatcher\EventDispatcher. This leads me to suspect that Drupal is resolving EvenDispatcher to the preferred one from Symfony but the module is still specifying to use the Drupal ContainerAwareEventDispatcher.
Changing Drupal\Component\EventDispatcher\ContainerAwareEventDispatche to Symfony\Component\EventDispatcher\EventDispatche as well as ContainerAwareEventDispatcher to EventDispatcher in TermMerger.php resolves the issue.
- πͺπΈSpain joristhedrupalist
Yes same here 11.1.1
here is a patch as the fix is very simple - π¨π¦Canada superfedya
The patch doesn't works for me.
Drupal\term_merge\TermMerger::__construct(): Argument #3 ($dispatcher) must be of type Symfony\Component\EventDispatcher\EventDispatcher, Drupal\tracer\EventDispatcher\TraceableEventDispatcher given, called in /www/site/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259
in /www/site/web/modules/contrib/term_merge/src/TermMerger.php (line 56)
- π²πΎMalaysia stevechai
Hi, the patch is working for term_merge 2.0.0-beta6 on drupal 11.1. Thanks for the patch.
- π¬π§United Kingdom scott_euser
scott_euser β changed the visibility of the branch 3499000-typeerror to hidden.
- Status changed to Needs review
about 1 month ago 1:12pm 28 April 2025 - π¬π§United Kingdom scott_euser
Change record causing this fatal error: [#3376090]
- Merge request !28#3499000: TypeError in TermMerger due to deprecation of ContainerAwareEventDispatcher β (Open) created by scott_euser
- π¬π§United Kingdom scott_euser
scott_euser β changed the visibility of the branch 8.x-1.x to hidden.
- π¬π§United Kingdom scott_euser
Okay did a bit of issue clean-up. Now targets 2.0.x as expected, hid extra patches and branches to avoid confusion. Per https://www.drupal.org/node/3376090 β this is now critical as the core functionality of this module (to merge terms) is not usable in Drupal 11 which is a supported version of Drupal Core.
Would be great to get an RTBC from someone in the community so we can get this infront of maintainers eyes. Thanks