base:block has no corresponding route

Created on 14 August 2023, over 1 year ago
Updated 2 December 2023, about 1 year ago

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

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

  • Issue created by @Anybody
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    Not currently mergeable.
  • @anybody opened merge request.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    16 pass, 2 fail
  • 🇩🇪Germany Anybody Porta Westfalica

    MR as static patch attached!

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    17 pass
  • 🇩🇪Germany Anybody Porta Westfalica

    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.

  • 🇩🇪Germany Anybody Porta Westfalica

    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!

  • 🇨🇦Canada michaelschutz

    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.

  • Status changed to Fixed about 1 year ago
  • 🇨🇦Canada adriancid Montreal, Canada

    Thanks

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

  • Status changed to Fixed about 1 year ago
  • 🇦🇺Australia almunnings Melbourne, 🇦🇺

    This patch has introduced a new issue.

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

    $original_link is null.

  • 🇦🇺Australia almunnings Melbourne, 🇦🇺
  • 🇨🇦Canada xmacinfo Canada

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

Production build 0.71.5 2024