Cannot delete a config menu link

Created on 1 July 2016, over 8 years ago
Updated 23 February 2023, almost 2 years ago

What is the procedure to delete a config menu link? There is no "delete" option, only "edit". Do I need to export config, remove the yml file for the link then reimport?

But if I do remove via config import, navigating to the menu in admin/structure causes this error:

PHP Fatal error: Class 'Drupal\Component\Utility\String' not found in menu_link_config/src/Plugin/Menu/MenuLinkConfig.php on line 109

Steps to reproduce

  1. Create menu link config link e.g. /admin/structure/menu/manage/main/add_config_link
  2. Export config
  3. Delete the menu link you just created
  4. Import config
  5. Visit menu config e.g. /admin/structure/menu/manage/main OR any page where the menu is visible, see WSOD below
  6. drush cr does not help
The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginException: Entity not found through the menu link plugin definition and could not fallback on ID test in Drupal\menu_link_config\Plugin\Menu\MenuLinkConfig->getEntity() (line 108 of modules/contrib/menu_link_config/src/Plugin/Menu/MenuLinkConfig.php).

Drupal\menu_link_content\Plugin\Menu\MenuLinkContent->getTitle() (Line: 238)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->generateIndexAndSort()
call_user_func() (Line: 148)
Drupal\Core\Menu\MenuLinkTree->transform() (Line: 236)
Drupal\menu_ui\MenuForm->buildOverviewForm() (Line: 150)
Drupal\menu_ui\MenuForm->form() (Line: 149)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 91)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)
require('/home/andi/git/site-h4c-dev-local/web/index.php') (Line: 46)
πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ransomweaver

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.

Production build 0.71.5 2024