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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gwvoigt created an issue. See original summary.

gwvoigt’s picture

StatusFileSize
new375 bytes
gwvoigt’s picture

Status: Active » Needs review

bbombachini made their first commit to this issue’s fork.

bbombachini’s picture

This worked for me so I created a MR with the fix.

swentel’s picture

Related, but doesn't have to be fixed here I guess: if you don't have permission to a particular config page, you will still see it in the menu, even though access will be denied when clicking on the link.

  • shumer committed e9ce6d70 on 8.x-2.x authored by bbombachini
    Issue #3379375: Can't edit config page menu item due to missing provider...
swentel’s picture

Actually, scratch my last remark, it's related to the 'link to any page' permission in core.

shumer’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

art4003’s picture

This still seems to be an issue. I am using an admin user which should have all permissions and I am still getting an error when accessing a config page link from the admin menu.

The patch does seem to resolve the issue.