No field in migrate link

Created on 27 July 2020, over 4 years ago
Updated 23 June 2023, over 1 year ago

Hi,

Problem/Motivation

I migrated menu link d7 to d8. D7 menu link contains extra field which stored in options columns database. In my migration, I can load information, but i can't store in my field in D8. Furthemore, when the link had migrate, in edit page, the field create with the module item extra is missing, but, I can see the field, in the same menu, if I add a new link.

Steps to reproduce

Migrate menu (no link)
Add field
Migrate link
Link was imported didn't contain the new field

Maybe I do something wrong but, I tested a lot of configuration...

πŸ› Bug report
Status

Fixed

Version

2.11

Component

Menu item form

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡Έ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();"
    
Production build 0.71.5 2024