Can't edit config page menu item due to missing provider in config_pages_menu_links_discovered_alter()

Created on 4 August 2023, over 1 year ago
Updated 24 July 2024, 4 months ago

Problem/Motivation

In config_pages.module config_pages_menu_links_discovered_alter() hook, the config_pages link list is being created with a missing key "provider" in the $links array. This is causing an UnknownExtensionException when trying to edit this link created via config_pages module using the edit button under Structure -> Menus -> Menu Name -> Link (edit).

Drupal\Core\Extension\Exception\UnknownExtensionException: The module does not exist. in Drupal\Core\Extension\ExtensionList->get() (line 265 of core/lib/Drupal/Core/Extension/ExtensionList.php).
Drupal\Core\Extension\ExtensionList->getName('') (Line: 737)
Drupal\Core\Extension\ModuleHandler->getName('') (Line: 99)
Drupal\Core\Menu\Form\MenuLinkDefaultForm->buildConfigurationForm(Array, Object) (Line: 74)
Drupal\menu_ui\Form\MenuLinkEditForm->buildForm(Array, Object, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('menu_link_edit', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 270)
Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 137)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

  1. Create a new Config Page type.
  2. Set a Menu in the entity form. E.g.: /admin/content/my-config-page
  3. Go to Structure -> Menus and select the menu you've placed the Cofnig page into.
  4. Locate your menu item and try to edit it.

Proposed resolution

Add the missing "provider" parameter to the $links array.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada gwvoigt London, ON πŸ‡¨πŸ‡¦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024