drush features-components menu_links
should show a complete list of menu links for menus where features is enabled.

Currently, only items are shown where the user has access.

The reason is in menu_links_features_export_options().
This uses menu_parent_options() to build the list.
This function uses menu_tree_all_data() which filters out items without access.

In drush the user is like "anonymous", so only the items shown are those open to the public.
E.g. if the path is "admin" or "admin/structure", it will not show up in the list.

Other parts of menu_links integration do not have this limitation.

(the same problem occurs in features' own implementation)

Comments

donquixote created an issue. See original summary.

donquixote’s picture

The function contains code which is meant to reveal those hidden items.

function menu_links_features_export_options() {
  global $menu_admin;
  // Need to set this to TRUE in order to get menu links that the
  // current user may not have access to (i.e. user/login).
  $menu_admin = TRUE;

Unfortunately this does not work in drush, where the user is anonymous.

function user_is_anonymous() {
  // Menu administrators can see items for anonymous when administering.
  return !$GLOBALS['user']->uid || !empty($GLOBALS['menu_admin']);
}

The "correct" solution is to load everything from the database.

donquixote’s picture

Title: "drush fc menu_links" only shows menu links with public access » "drush fc menu_links_uuid" only shows menu links with public access

Changing drush command in title.