Access denied on System Admin Menu Block Access Check

Created on 11 July 2025, 3 days ago

Problem/Motivation

Trying to create a menu link with the parent set to system.admin and the route name set to a custom route. On my routing.yml the controller I am pointing to is using: _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'

and the requirements are set to _access: 'TRUE'. When I visit the route i get an access denied message.

Steps to reproduce

routing.yml:
```
example_mod.admin_index:
path: '/admin/example_mod'
defaults:
_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
_title: 'Example Mod'
requirements:
_access: 'TRUE'
```

links.menu.yml:
```
example_mod.admin_index:
title: Example Mod
route_name: example_mod.admin_index
parent: system.admin
description: 'Example Mod'
position: left
weight: 0
```

Proposed resolution

the function `hasAccessToChildMenuItems` in /web/core/modules/system/src/Access/SystemAdminMenuBlockAccessCheck.php

seems to be returning AccessResult::neutral() for some reason.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.2 πŸ”₯

Component

system.module

Created by

πŸ‡ΊπŸ‡ΈUnited States blu_regard

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

Comments & Activities

Production build 0.71.5 2024