0

Facing one issue in deleting the menu items on my Drupal 8 Site.

Steps to reproduce:

Add a link to main menu.

Create Child terms under one link.

Delete the parent term.

After deleting the parent link child links stays they don't get deleted automatically.

If you want to edit/manually delete those links then a Fatal error is
coming.

Error Message : Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID 'menu_link_content:adad91f8-19c7-48c7-a88e-67aae4edd21e' was not found. in Drupal\Core\Menu\MenuLinkManager->getDefinition() (line 207 of /var/www/crain-platform/docroot/core/lib/Drupal/Core/Menu/MenuLinkManager.php).

After doing some debugging i see the menu data missing from menu_link_content table.Anyone have any idea why this is coming and how to fix this issue?

1
  • You mean fix the issue in general? Then this post would be a good issue report, you should file it on drupal.org. For your specific menu link? You can set parent to NULL in the table menu_link_content_data and clear the cache to rebuild the menu tree.
    – 4uk4
    Commented Nov 17, 2017 at 7:53

1 Answer 1

0

This error was coming because of responsive menu module.Responsive menu was fetching the parent links using

\Drupal::service('plugin.manager.menu.link')->createInstance($parent);

Adding the condition before calling createInstance will fix this issue.

\Drupal::service('plugin.manager.menu.link')->hasDefinition($parent)

Created a issue on D.o also

https://www.drupal.org/project/1786786/issues/2924229

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.