- Issue created by @zaporylie
- Status changed to Needs review
over 1 year ago 6:16pm 11 July 2023 - 🇮🇳India Akram Khan Cuttack, Odisha
I reviewed the above patch and it's resolved the issue. Before patch when i try to extend the module it gives fatal error and after applying patch the module enabled successfully. Additionally, I have attached before and after state screenshots for reference.
- 🇳🇱Netherlands wilfred waltman
Thanks to you both. I will taak a look at the patch soon.
- Assigned to wilfred waltman
- Status changed to Closed: cannot reproduce
over 1 year ago 2:08pm 19 July 2023 - 🇳🇱Netherlands wilfred waltman
I can not reproduce this. Maybe it is fixed by the implemented coding standards fixes
I was able to reproduce this error in Drupal 10, looking at the Core RouteSubscriber libraries, adding ":array" in the function declaration solved my problem.
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array {
$events = parent::getSubscribedEvents();
$events[RoutingEvents::ALTER] = ['onAlterRoutes', 100];
return $events;
}I leave the patch in the hands of whoever wants to do it.
Greetings.- 🇩🇪Germany thomaswalther Rhein-Main Area
I got this error on updating Drupal 9.5.11 to Drupal 10 with composer.
This is also in other modules, the same file.
To find all the affected files:
find ./ -type f -exec grep -Hni "getSubscribedEvents() {" {} \;
Shell command for 1 file:
sed -i 's/getSubscribedEvents() {/getSubscribedEvents():array {/g' ./modules/contrib/entity_usage_light/src/Routing/RouteSubscriber.php