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
- Create a new Config Page type.
- Set a Menu in the entity form. E.g.: /admin/content/my-config-page
- Go to Structure -> Menus and select the menu you've placed the Cofnig page into.
- 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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | cant-edit-config-page-menu-link-3379375.patch | 375 bytes | gwvoigt |
Issue fork config_pages-3379375
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
Comment #2
gwvoigtComment #3
gwvoigtComment #6
bbombachiniThis worked for me so I created a MR with the fix.
Comment #7
swentel commentedRelated, 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.
Comment #9
swentel commentedActually, scratch my last remark, it's related to the 'link to any page' permission in core.
Comment #10
shumer commentedComment #12
art4003 commentedThis 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.