Skip to content

Fix RouteSubscriber for admin routes #16

@iperaltamrmilu

Description

@iperaltamrmilu

Many routes as /admin/dblog or /admin/content aren't set as _admin_route in their yml and following option is not set:

    foreach ($collection->all() as $route_name => $route) {
      if (
        str_starts_with($route_name, 'system.')
        || str_starts_with($route_name, 'view.')
        || $route->getOption('_admin_route')
        || ($route->getPath() === '/')
      ) {
        $route->setDefault('_disable_alias_subpaths', TRUE);
      }
    }

The reason is _admin_route is set in AdminRouteSubscriber and previous functionality is executed before, reading only yml file.

Also, setDefault doesn't work properly in onRequest because following condition is not checked:

    if ($request->attributes->get('_disable_alias_subpaths')) {
      return;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions