- πΊπΈUnited States webdrips
Note: this still works fine on version 3.x of the module.
/** * Helper function from menu_item_extras_install to fix the link bundles. */ function MYMODULE_fix_menu_link_bundles() { \Drupal::entityTypeManager()->clearCachedDefinitions(); $menus = \Drupal::entityTypeManager() ->getStorage('menu') ->loadMultiple(); /** @var \Drupal\menu_item_extras\Service\MenuLinkContentService $mlc_helper */ $mlc_helper = \Drupal::service('menu_item_extras.menu_link_content_helper'); $mlc_helper->doEntityUpdate(); $mlc_helper->updateMenuLinkContentBundle(); $mlc_helper->installViewModeField(); if (!empty($menus)) { foreach ($menus as $menu_id => $menu) { $mlc_helper->updateMenuItemsBundle($menu_id); } } $mlc_helper->doBundleFieldUpdate(); } drush cr drush eval "MYMODULE_fix_menu_link_bundles();"