- 🇪🇸Spain jonodunnett
With the help of mglaman/composer-drupal-lenient and cweagans/composer-patches I can require and patch the module for my D10 project. The patch from #5 applies cleanly (and already contains the changes from #3 patch). Unfortunately, when I try to access the front page (the single page site) there is an error. In the Drupal log this is the error:
TypeError: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch(): Argument #1 ($event) must be of type object, string given, called in C:\wamp64\www\REPOS\D8-multi\httpdocs\modules\contrib\single_page_site\src\Manager\SinglePageSiteManager.php on line 277 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (line 89 of C:\wamp64\www\REPOS\D8-multi\httpdocs\core\lib\Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher.php).
Sorry but I don't have the expertise to diagnose further.
- 🇪🇸Spain jonodunnett
I surprised myself.. The issue seems to be the one documented here https://www.drupal.org/project/drupal/issues/3055194 →
Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.
I switched the order (put the $event first) at the four locations I found the method in \src\Manager\SinglePageSiteManager.php and that fixed the problem.
Here is the combined patch that is working for me on d10.