Fixes for link definitions provided by @ProfileManager plugins

Created on 24 January 2024, 10 months ago
Updated 7 February 2024, 9 months ago

Problem/Motivation

1.

The link_id definitions in @ProfileManager plugin annotations causes routes/links of those plugins not to be loaded for non admin users. This happens because of the core addition in 10.2 made here which tries to load the links from the menu tree storage for access checking. When that happens, link_id is somehow included in the route parameters whereas it's not present in the menu link definition stored in the DB. As a consequence the links aren't loaded. Admin users don't have this issue because they seem to be by-passing this new access check.

2.

Further it's currently not possible to edit links provided by @ProfileManager plugins from the MenuForm for the administration menu because the link definitions are added without a provider. As a result opening the edit form of such links will throw a fatal error:

DrupalCore Extension Exception\UnknownExtensionException: The module does not exist. in DrupaßCore Extension ExtensionList->get() (line 267 of core/lib/Drupal/Core/Extension/ExtensionList.php).
rupal\Core\Extension\ExtensionList->getName('') (Line: 720)
rupal\Core\Extension \ModuleHandler->getName('') (Line: 99)
rupal\Core\Menu\Form\MenuLinkDefaultForm->buildConfigurationForm(Array, Object) (Line: 74)
rupal\menu_ui\Form\MenuLinkEditForm->buildForm(Array, Object, Object)
call_user_func_array(Array, Array) (Line: 536)
upanCoreform Fornbuider-buiaorobene, Objec) Eine?gt) (Line: 283)
rupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
rupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
rupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object,
1, 1) (Line: 58)
rupal\Core\StackMiddleware|Session->handle(Object, 1, 1) (Line: 48)
upaCorestackidewarecontentengt-Sandle1060606,1, 1) Le:16))
rupal\page_cache|StackMiddleware\PageCache->pass (Object, 1, 1) (Line: 85)
rupaicorestacnsddlewareleeversProxeateware-handle ob;e, 171) (ine: 52)
upaliCore1stacknideware/Ajapagestate-shandeobjecte(059tie: 51)ne: 36)
rupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

1.

  • Log in using the any non admin role that can access the ProfileManager toolbar
  • Make sure the a toolbar consisting of ProfileManager links contains all links that are also present when logging in using an admin user

2.

  • Navigate to the Administrative menu edit form and edit any link provided by a ProfileManager plugin.
  • Without the changes in the MR here, this will throw the error above.

Proposed resolution

Remove the link_id from annotations and add a provider for added link definitions.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024