Steps to reproduce
- Install a clean Drupal 8 with the Standard installation profile
- Go to
admin/structure/menu/manage/mainand disable the Home menu item. This will write the menu item tocore.menu.static_menu_link_overrides. - Delete file
core/profiles/standard/standard.links.menu.yml - Clear cache
- Try to delete the orphaned menu item:
$home_manager = \Drupal::service('plugin.manager.menu.link'); $home_manager->removeDefinition('standard.front_page');
Expected behavior
We are able to delete the menu item.
Actual behavior
We get the following error:
Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginException: "Menu link plugin with ID 'standard.front_page' does not support deletion".
Also, trying to reset the menu item at admin/structure/menu/link/standard.front_page/reset results in a fatal error:
Recoverable fatal error: Argument 1 passed to Drupal\Core\Menu\MenuTreeStorage::save() must be of the type array, null given, called in /Users/wim.mostrey/Sites/drupal82/core/lib/Drupal/Core/Menu/MenuLinkManager.php on line 406 and defined in /Users/wim.mostrey/Sites/drupal82/core/lib/Drupal/Core/Menu/MenuTreeStorage.php on line 257
We are now stuck with a menu item that can not be deleted nor reset.
Comments
Comment #2
wmostrey commentedComment #14
smustgrave commentedThank you for reporting this problem. We rely on issue reports like this one to resolve bugs and improve Drupal core.
Since there has been no activity here for over 8 years we are asking if this problem persists on a currently supported version of Drupal. To help, add a comment explaining if the problem still occurs or not. Any extra detail you can provide can help others who experienced this.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #16
smustgrave commentedSince there's been no follow up to confirm going to close this one out. If still an issue in D11+ please re-open