Incorrect event registration in RouteSubscriberBase

Created on 27 May 2022, over 2 years ago
Updated 27 June 2023, about 1 year ago

Problem/Motivation

Getting this warning when running drush

Array
(
    [routing.route_alter] => Array
        (
            [eventName] => onAlterRoutes
        )

)
 [warning] Invalid argument supplied for foreach() RegisterEventSubscribersPass.php:38

Proposed resolution

RouteSubscriberBase::getSubscribedEvents() is registering its event like so
$events[RoutingEvents::ALTER] = 'onAlterRoutes';
Per https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Routing%2... the 'onAlterRoutes' event should be returned in an array.

πŸ› Bug report
Status

Closed: outdated

Version

9.5

Component
RoutingΒ  β†’

Last updated 8 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024