Problem/Motivation

When downgrading a user from Administrator to a lower role, he gets a WSOD and can't use the project anymore. Clearing caches and rebuilding access permissions doesn't help.

Backtrace:

UnexpectedValueException: base:block has no corresponding route. in Drupal\Core\Url->getRouteName() (line 567 of core/lib/Drupal/Core/Url.php).

admin_toolbar_links_access_filter_filter_non_accessible_links() (Line: 52)
admin_toolbar_links_access_filter_preprocess_menu()
call_user_func_array() (Line: 287)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 118)
Drupal\toolbar\Controller\ToolbarController::Drupal\toolbar\Controller\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 119)
Drupal\toolbar\Controller\ToolbarController::preRenderGetRenderedSubtrees()
call_user_func_array() (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 788)
Drupal\Core\Render\Renderer->doCallback() (Line: 374)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 285)
{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 286)
toolbar_get_rendered_subtrees() (Line: 297)
_toolbar_get_subtrees_hash() (Line: 168)
toolbar_toolbar()
call_user_func_array() (Line: 426)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 433)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 81)
Drupal\toolbar\Element\Toolbar::preRenderToolbar()
call_user_func_array() (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 788)
Drupal\Core\Render\Renderer->doCallback() (Line: 374)
Drupal\Core\Render\Renderer->doRender() (Line: 446)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 83)
__TwigTemplate_7a8aff35746c404ed4bab73dd72bd985->doDisplay() (Line: 405)
Twig\Template->displayWithErrorHandling() (Line: 378)
Twig\Template->display() (Line: 390)
Twig\Template->render() (Line: 55)
twig_render_template() (Line: 384)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 162)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 163)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Any ideas?

Switching the user back to Administrator makes the error go away.

Steps to reproduce

Proposed resolution

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

Anybody created an issue. See original summary.

anybody’s picture

Title: base:block has no corresponding route » 3380953-baseblock-has-no-corresponding-route
Version: 3.4.1 » 3.x-dev
StatusFileSize
new5.4 KB

MR as static patch attached!

anybody’s picture

Status: Active » Needs review

Seems like this was fixed in latest 3.x-dev! Happens only in 3.4.1 for me. So maybe a new tagged release would be nice?

Leaving this open for review, but might be closed then.

anybody’s picture

Title: 3380953-baseblock-has-no-corresponding-route » base:block has no corresponding route
Priority: Normal » Major

Just ran into this in another installation, this time with the error:

UnexpectedValueException: base:admin/reports/data-policy-agreements has no corresponding route. in Drupal\Core\Url->getRouteName() (line 567 of core/lib/Drupal/Core/Url.php).

admin_toolbar_links_access_filter_filter_non_accessible_links() (Line: 98)
admin_toolbar_links_access_filter_filter_non_accessible_links() (Line: 52)
admin_toolbar_links_access_filter_preprocess_menu()
call_user_func_array() (Line: 287)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 118)
Drupal\toolbar\Controller\ToolbarController::Drupal\toolbar\Controller\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 119)
Drupal\toolbar\Controller\ToolbarController::preRenderGetRenderedSubtrees()
call_user_func_array() (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 788)
Drupal\Core\Render\Renderer->doCallback() (Line: 374)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 285)
{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 286)
toolbar_get_rendered_subtrees() (Line: 297)
_toolbar_get_subtrees_hash() (Line: 168)
toolbar_toolbar()
call_user_func_array() (Line: 426)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 433)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 81)
Drupal\toolbar\Element\Toolbar::preRenderToolbar()
call_user_func_array() (Line: 101)

So raising the priority for a new tagged release!

michaelschutz’s picture

Just confirming that this issue exists for me in one of my sites as well, using the OpenSocial profile (v11.10.1) which requires Admin Toolbar 3.4.1. Got a WSOD after updating, and the error message was that from #5. Applying the patch in #3 fixed it.

adriancid’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

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

almunnings’s picture

This patch has introduced a new issue.

if ($url->isExternal() || !$original_link->getUrlObject()->isRouted()) {

$original_link is null.

Error: Call to a member function getUrlObject() on null in admin_toolbar_links_access_filter_filter_non_accessible_links() (line 84 of modules/contrib/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module).
almunnings’s picture

StatusFileSize
new787 bytes
xmacinfo’s picture

@almunnings Please open a new issue and put your patch there.

rteijeiro’s picture

I created a new issue as suggested in #12 for the issue reported in #10 and re-rolled the patch: https://www.drupal.org/project/admin_toolbar/issues/3528054