Alter local task before access check

Created on 12 July 2019, almost 5 years ago
Updated 26 January 2023, over 1 year ago

Problem/Motivation

Using hook_menu_local_tasks_alter is possible to alter the local tasks before they are rendered, but the access checks are being done before this hook and some of them use the route_match to check entity access, this produces weird errors with custom local tasks coming from different entities than the entity referenced in the current route.

Those local tasks from different entities are included due to the $base_routes from function getLocalTasksForRoute in the LocalTaskManager.

Proposed resolution

Create a new hook called hook_menu_tasks_build_alter useful for really unset local tasks without cheking their access.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Menu system 

Last updated 1 day ago

Created by

🇨🇴Colombia jidrone

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.69.0 2024