When enabling Admin Toolbar Links Access Filter (an Admin toolbar submodule) we got this error:
Error: Call to a member function getMenuName() on null in admin_toolbar_links_access_filter_preprocess_menu() (line 48 of modules/contrib/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module).
Diagnostic
First I thought it came from Admin toolbar module, but can't find any related issue, except a very old one which has been closed, apparently because it is outdated...
When debugging the code at this line into admin_toolbar_links_access_filter_preprocess_menu() we can find that a key $first_link['original_link'] is missing in the menu item.
And it seems that this key is missing for the menu items dynamically generated by Contenta Enhancements submodule, from contenta_enhancements_toolbar_alter() :
Encountered issue
When enabling Admin Toolbar Links Access Filter (an Admin toolbar submodule) we got this error:
Error: Call to a member function getMenuName() on null in admin_toolbar_links_access_filter_preprocess_menu() (line 48 of modules/contrib/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module).
Diagnostic
First I thought it came from Admin toolbar module, but can't find any related issue, except a very old one which has been closed, apparently because it is outdated...
When debugging the code at this line into
admin_toolbar_links_access_filter_preprocess_menu()
we can find that a key$first_link['original_link']
is missing in the menu item.And it seems that this key is missing for the menu items dynamically generated by Contenta Enhancements submodule, from
contenta_enhancements_toolbar_alter()
:Proposed solution
The solution may be to load an existing menu item, pointing to this routes, and add it to this arrays into this
original_link
key?