checkNodeAccess override a custom DefaultMenuLinkTreeManipulators

Created on 10 December 2021, over 3 years ago
Updated 16 June 2025, 21 days ago

Problem/Motivation

I am working with a custom plugin that extends the DefaultMenuLinkTreeManipulators class, where I filter menu links for some users.

The plugin is replacing the menu.default_tree_manipulators service.

All works fine if I put the menu in any block region. When I use the menu in a field, the menu is instantiated and the menu links are filtered less the menu items a link to a node (the links with external paths or internals to views or taxonomies works fine).

I found that the Call to 'menu.default_tree_manipulators:checkNodeAccess' is overriding my filtering.

Proposed resolution

This is a custom solution that works for my case. If anyone else has custom validations on DefaultMenuLinkTreeManipulators getting overrieded by 'menu.default_tree_manipulators:checkNodeAccess' then you can use it.

Generate a patch where remove the following element from the manipulator array:

['callable' => 'menu.default_tree_manipulators:checkNodeAccess'],

If anyone has observations your comments are welcome.

πŸ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡²πŸ‡½Mexico carlos-perez

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

Merge Requests

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