- 🇬🇧United Kingdom andrew robinson
I believe these patches fail in Drupal 10 sites with the error:
Uncaught Error: Class "Symfony\Component\EventDispatcher\Event" not found in modules/contrib/paragraphs/src/Event/ParagraphSummaryAlterEvent.php:4
According to
vendor/symfony/event-dispatcher/CHANGELOG.md
, in Symfony 5.x
Based on this I think the use statement at the top of
src/Event/ParagraphSummaryAlterEvent.php
should be updated
from
use Symfony\Component\EventDispatcher\Event;
to
use Symfony\Contracts\EventDispatcher\Event;
for sites that are based on Symfony 5 or above.
- 🇩🇪Germany a.dmitriiev
@vladigor@gmail.com In patch #38 this class is not used. It uses the class
Drupal\Component\EventDispatcher\Event
according to change record: https://www.drupal.org/node/3159012 → - last update
over 1 year ago 180 pass - 🇬🇧United Kingdom andrew robinson
Thanks @a.dmitriiev.
I've switched over to patch #38 on my Drupal 10.1.0 site using Paragraphs 1.15.0.
When I try to edit a page that contains paragraphs I get the following error:TypeError: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch(): Argument #1 ($event) must be of type object, string given, called in /app/docroot/modules/contrib/paragraphs/src/Entity/Paragraph.php on line 468 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (line 89 of core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php).
It appears that in Drupal 10.1 the event_dispatcher service uses the dispatch function from ContainerAwareEventDispatcher.php, which expects $event as the first parameter.
Ref. https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Even...I've attached an updated version of patch #38 that switches around the parameters in the two calls to the dispatch function.
- last update
over 1 year ago 159 pass, 12 fail - Status changed to Needs review
over 1 year ago 7:53am 3 July 2023 - 🇧🇪Belgium LRoels Ghent
Changing the status to needs review for now. Seems wrong to keep it on RTBC.
- 🇬🇧United Kingdom LiamPower
#42 is working for me with Drupal 10.1.5 and Paragraphs 8.x-1.16
- Status changed to RTBC
about 1 year ago 11:38am 3 November 2023 - last update
12 months ago Composer require-dev failure - 🇺🇸United States gmercer
Re-rolled #42 patch to check for empty of summary[$type] on appendTextToSummary() and prependTextToSummary() in src/Event/ParagraphSummaryAlterEvent.php