TransWikia.com

Fatal error while editing and deleting menu items

Drupal Answers Asked by ashutoshsngh on December 31, 2021

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 : DrupalComponentPluginExceptionPluginNotFoundException: Plugin ID ‘menu_link_content:adad91f8-19c7-48c7-a88e-67aae4edd21e’ was not found. in DrupalCoreMenuMenuLinkManager->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?

One Answer

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

Answered by ashutoshsngh on December 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP