When I enable "Overwrite internal link target access check" so I can disable menus, I receive a WSOD for anonymous users.

The error logged is
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "views_view" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 133 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

This may be being caused by a menu item being created by views.

CommentFileSizeAuthor
#15 3005803-15.patch795 bytesLiamPower
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Spanxya created an issue. See original summary.

Spanxya’s picture

Issue summary: View changes
LiamPower’s picture

Status: Active » Postponed (maintainer needs more info)

Can you try clearing your caches with drush?

Is there anything else you had recently done, added or removed any modules?

Spanxya’s picture

Can you try clearing your caches with drush?

Fair call. I gave it a go, but the behaviour was the same.

Is there anything else you had recently done, added or removed any modules?

Nothing comes to mind. I can cause this by simply toggling "Overwrite internal link target access check"

LiamPower’s picture

I'll give the scenario a run when I get a chance if you get a chance to before I do. Could you let me know if updating your links to or to google or something makes a difference?

Spanxya’s picture

Sorry it took a while to get back to you. Looks like I missed the notification.

I've just swapped out all of the route:<nolink>s with https://google.com and I am seeing the same result. Clearly that's not the issue. Sorry about the misdirection.

Spanxya’s picture

Issue summary: View changes
Spanxya’s picture

On further research, I have found that one menu item was a view. When this menu item is enabled I get an error, with it disabled the module performs as expected.

The view has permission restrictions: permission: view published content.

Actually, I've changed it to permissions: none, and back again and this error seems to have gone away.

Now I'm wondering if it was to do with having this view on a menu before menu_item_role_access was installed.

Anyway, for me, for now, I have no problems. Thanks for taking the time to respond LiamPower

LiamPower’s picture

Status: Postponed (maintainer needs more info) » Needs work

Hi @Spanxya

Thanks for investigating further and letting me know where the issue is. I think I'm going to take a look and see if there is something I can do to stop the WSOD if a view menu item has been added to the menu as I don't think this module should be causing an issue with that, it should just pass over that menu item and pass off the permission checking to the view.

Thanks,
Liam

LiamPower’s picture

Issue summary: View changes
LiamPower’s picture

Status: Needs work » Closed (cannot reproduce)

I'm unable to replicate this error.

drupgirl’s picture

Status: Closed (cannot reproduce) » Active

I just replicated the anon WSOD. Spanxya, thank you so much for making this post because disabling this module brought the site back. I would have been stymied for much longer trying to sort this message out and relating it back to this module...

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "views_view" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 133 of .../code/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

I'm going to reopen this, because it is a thing, and it would be good for others to know that when the get this message, disabling the mod brings the site back. I only noticed after logging out as as admin. drush uli got me back in, where I could then access the error log.

I do concur that the issue is probably related to views adding menu links to the menu when this mod is installed.

LiamPower’s picture

Status: Active » Postponed (maintainer needs more info)

@drupgirl are you able to provide any more information about this:

  • What are the configurations used from within Menu Item Role Access?
  • Had you only just installed the Menu Item Role Access module?
  • Had caches been cleared?

It would be great if you could help me to replicate this as I'm still unable to replicate it.

smmoraco’s picture

I found that i was able to cause and then clear up the cause for this error simply by toggling module settings:

[ ] Overwrite internal link target access check
[ ] Allow parents to override children

When i first found the problem i had both checked.
I found the problem occurred in two places on my site: (1) showing the calendar view, and (2) editing an existing basic page.

My workaround for now was to turn off both of these options.

Here are the stack traces from both:

### Error accessing calendar page

The website encountered an unexpected error. Please try again later.Drupal\Component\Plugin\Exception\PluginNotFoundException: The "views_view" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 150 of core/lib/Drupal/Core/Entity/EntityTypeManager.php). 
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('views_view', 'views.full_event_calendar.page_1') (Line: 192)
Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator->loadByUuid('views_view:views.full_event_calendar.page_1') (Line: 131)
Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator->getOverridingParent(Object) (Line: 83)
Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator->menuLinkCheckAccess(Object) (Line: 92)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess(Array) (Line: 96)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess(Array)
call_user_func(Array, Array) (Line: 148)
Drupal\Core\Menu\MenuLinkTree->transform(Array, Array) (Line: 197)
Drupal\system\Plugin\Block\SystemMenuBlock->build() (Line: 163)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 161)
__TwigTemplate_5f64cab1a9cc723eba9b39f86b3f4f7970dac532764bdf2f636feae9e7c05205->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/contrib/professional_responsive_theme/templates/layout/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 100)
__TwigTemplate_32a2edb484b90e65acc55259a9afd95dac4d40309c12c520a9957770f687b382->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/contrib/professional_responsive_theme/templates/layout/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

### Error accessing page edit

The website encountered an unexpected error. Please try again later.Drupal\Component\Plugin\Exception\PluginNotFoundException: The "views_view" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 150 of core/lib/Drupal/Core/Entity/EntityTypeManager.php). 
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('views_view', 'views.full_event_calendar.page_1') (Line: 192)
Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator->loadByUuid('views_view:views.full_event_calendar.page_1') (Line: 131)
Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator->getOverridingParent(Object) (Line: 83)
Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator->menuLinkCheckAccess(Object) (Line: 92)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess(Array) (Line: 96)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess(Array)
call_user_func(Array, Array) (Line: 148)
Drupal\Core\Menu\MenuLinkTree->transform(Array, Array) (Line: 84)
Drupal\Core\Menu\MenuParentFormSelector->getParentSelectOptions('menu_link_content:9fbef5f2-048d-40b6-9fd2-858dcd9cec23', Array, Object) (Line: 95)
Drupal\Core\Menu\MenuParentFormSelector->parentSelectElement('main:', 'menu_link_content:9fbef5f2-048d-40b6-9fd2-858dcd9cec23', Array) (Line: 242)
menu_ui_form_node_form_alter(Array, Object, 'node_page_edit_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_page_edit_form') (Line: 835)
Drupal\Core\Form\FormBuilder->prepareForm('node_page_edit_form', Array, Object) (Line: 277)
Drupal\Core\Form\FormBuilder->buildForm('node_page_edit_form', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
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: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
LiamPower’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
795 bytes

Thanks for the stack trace @smmoraco

Can you give the attached patch a try and let me know how you get on with it?

LiamPower’s picture

Version: 8.x-1.0 » 8.x-2.x-dev
jaesperanza’s picture

Haven't tried the patch yet. Just reporting same issue is still happening for:

Drupal version : 9.5.7
PHP Version 8.1.17
Module version: 8.x-2.19

Allow parents to override children is usable intermittently, I think as long as you run drush cache:rebuild

Enabling both options crashes the website with the same error