diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 95bb6b9..c9c5a55 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -151,6 +151,7 @@ function menu_entity_info_alter(&$entity_info) { $entity_info['menu']['controllers']['form'] = array( 'default' => 'Drupal\menu\MenuFormController', ); + $entity_info['menu_link']['entity_keys']['bundle'] = 'menu'; } /** @@ -158,14 +159,15 @@ function menu_entity_info_alter(&$entity_info) { */ function menu_entity_bundle_info() { $bundles = array(); - // Bundles must provide a human readable name so we can create help and error - // messages, and the path to attach Field admin pages to. - // @todo Probably need to read config. - foreach (menu_get_menus() as $name => $label) { - $bundles['menu_link'][$name] = array( - 'label' => $label, + $info = Drupal::service('plugin.manager.entity')->getDefinition('menu'); + $config_names = config_get_storage_names_with_prefix($info['config_prefix'] . '.'); + foreach ($config_names as $config_name) { + $config = config($config_name); + $bundles['menu_link'][$config->get('id')] = array( + 'label' => $config->get('label'), ); } + return $bundles; }