Hi,
As the public version throw fatal error on export (missing parameter) I've used the dev version.
But this time it's import that doesn't work.
First thing is the use of $key instead $menu_name to check existence of a menu :

      if (!Menu::load($key)) {
        $invalidMenus[] = $menu_name;
        continue;
      }

Second the module check existence of the combinaison of menu-name and menu-link-id.

      $menuLinkEntity = \Drupal::entityQuery('menu_link_content')
        ->condition('menu_name', $menu_name)
        ->condition('id', $key)
        ->execute();

The good practice is to use the UUID instead.
Other point is to unset the menu ID to prevent duplicate PRIMARY KEY exception.

CommentFileSizeAuthor
#2 2925814-import-not-working.patch876 bytesPtitKev
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

PtitKev created an issue. See original summary.

PtitKev’s picture

StatusFileSize
new876 bytes

Here is my participation. Work for me.
Does not have a multidimensional menu but since the parent ID is a UUID it should work.

joelpittet’s picture

Status: Active » Needs review
joelpittet’s picture

Status: Needs review » Needs work

It seems that the dev branch is behind the actual release tag for some reason. This patch doesn't apply against the latest code. Thanks for the proposed patch though, hopefully the maintainer can update the dev branch with the latest code.

sandeepguntaka’s picture

Thanks, I ve missed updating the dev branch of the repo. I just did.
Thanks again for pointing that.

sandeepguntaka’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sitiveni’s picture

Hi there,
I stumbled upon another "Duplicate entry" error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'XXX' for key 'menu_link_content__revision_id'

Solution is to unset the revision_id too:

      if (isset($menu['revision_id'])) {
        unset($menu['revision_id']);
      }