Problem/Motivation
admin_toolbar_links_access_filter_filter_non_accessible_links treat the menu item keys as route names but they are actually the menu id's. We can see that logic at the end of MenuLinkTree::buildItems
We can confirm this by seeing non routable id's in the list like admin_toolbar_tools.extra_links:flush_views
This was sort of a big performance hit prior to #3209342: Links without "original_link" are filtered by admin_toolbar_links_access_filter because we would do access checks on all these non-routable names. That seems to be fixed but the code still treats the key incorrectly.
Steps to reproduce
I haven't found a specific bug yet because #3209342: Links without "original_link" are filtered by admin_toolbar_links_access_filter seems to have fixed the problem I was running into this just needs to be cleaned to avoid future bugs I think. Maybe fix some edge case I haven't found.
Proposed resolution
Change the variable name and make sure the method only uses the resolved route name instead of the menu id.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | route_name_fix-3213710-2.patch | 2.74 KB | neclimdul |
Comments
Comment #2
neclimdulThis is the only notable change. Using route_name instead of the menu item key for the admin_toolbar_links_access_filter_is_overview_page call.
Comment #3
adriancidThanks