menu_get_item() only sets the $item['map'] if the user has access to the menu item.
However, the documentation does not say that the map property is conditional:
The router item or, if an error occurs in _menu_translate(), FALSE. A router item is an associative array corresponding to one row in the menu_router table. The value corresponding to the key 'map' holds the loaded objects.
Is there any reason it's omitted if there's no access? If not, it would be more consistent to always include it.
Comments
Comment #9
quietone commentedmenu_get_item() was removed from Drupal 8.x in #2177031: Remove menu_get_item() and every use of it. in Feb 2014.
Since this is tagged as needing backport I'll change this to the Drupal 7 issue queue.
Comment #10
quietone commentedReally change the version.
Comment #11
avpadernoTruly, it is not just
'map'that is not set;'page_arguments'and'theme_arguments'are not evenunserialize()'d.It seems early optimization which could cause issues. Code that checks whether the currently logged user has access to the router item relies on
$router_item['access'], not$router_item['map'].