Problem/Motivation
with the latest state of 11.x, a fresh site install with the standard profile (did a drush sql:drop right before), uninstalled the toolbar module and installed the navigation module plus a few more core modules(content moderation, responsive images, media), as soon as i am installing workspaces and workspaces ui i get the following new error:
The website encountered an unexpected error. Try again later.
Drupal\Core\Render\Component\Exception\InvalidComponentException: [navigation:toolbar-button/icon] NULL value found, but an object is required. in Drupal\Core\Theme\Component\ComponentValidator->validateProps() (line 232 of core/lib/Drupal/Core/Theme/Component/ComponentValidator.php).
Drupal\Core\Template\ComponentsTwigExtension->doValidateProps() (Line: 106)
Drupal\Core\Template\ComponentsTwigExtension->validateProps() (Line: 47)
__TwigTemplate_0fe65a4c3914659ea1cbf43cfba3b541->doDisplay() (Line: 388)
Twig\Template->yield() (Line: 151)
__TwigTemplate_820f6accfc70093bd7b1bb2211317ab1->{closure}() (Line: 2079)
Twig\Extension\CoreExtension::captureOutput() (Line: 77)
__TwigTemplate_820f6accfc70093bd7b1bb2211317ab1->macro_menu_items() (Line: 54)
__TwigTemplate_820f6accfc70093bd7b1bb2211317ab1->doDisplay() (Line: 388)
Twig\Template->yield() (Line: 344)
Twig\Template->display() (Line: 359)
Twig\Template->render() (Line: 51)
Twig\TemplateWrapper->render() (Line: 34)
twig_render_template() (Line: 380)
Drupal\Core\Theme\ThemeManager->render() (Line: 493)
Drupal\Core\Render\Renderer->doRender() (Line: 245)
Drupal\Core\Render\Renderer->doRenderRoot() (Line: 141)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 623)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 140)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 167)
Drupal\Core\Render\Renderer->doRenderPlaceholder() (Line: 725)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
Fiber->start() (Line: 733)
Drupal\Core\Render\Renderer->replacePlaceholders() (Line: 256)
Drupal\Core\Render\Renderer->doRenderRoot() (Line: 141)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 623)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 140)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 167)
Drupal\Core\Render\Renderer->doRenderPlaceholder() (Line: 725)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
Fiber->start() (Line: 733)
Drupal\Core\Render\Renderer->replacePlaceholders() (Line: 256)
Drupal\Core\Render\Renderer->doRenderRoot() (Line: 141)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 623)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 140)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 111)
Drupal\Core\Render\Renderer->renderRoot() (Line: 253)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->renderPlaceholders() (Line: 74)
Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor->processAttachments() (Line: 45)
Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond() (Line: 246)
Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() (Line: 206)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 216)
Symfony\Component\HttpKernel\HttpKernel->filterResponse() (Line: 204)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 715)
Drupal\Core\DrupalKernel->handle() (Line: 19)
the error is gone on ddev drush pmu navigation && ddev drush en toolbar and returns on ddev drush pmu toolbar && ddev drush en navigation. also searched the issue queue but havent found any matches yet.
(on ddev with php 8.3)
Steps to reproduce
- install the latest version of 11.x
- install the navigation module
- install workspaces ui module
Enabling just Navigation + Workspaces modules (without Workspaces UI module) does not seems to throw an error.
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | core_12310.mov | 1.02 MB | jatingupta40 |
Issue fork drupal-3523705
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
catchMoving this to navigation module.
Comment #5
rhezios commentedThe error is caused by rendering disabled links which are set as build item by \Drupal\navigation\Menu\NavigationMenuLinkTree::build(). By switching from menu tree to $build['items'] we ensure that only items inside the build array are altered
Patch #5 contains a re-roll against Drupal 11.1
Comment #6
libbna commentedIs the work still is progress? Because I applied the patch and checked, I am still getting the error.
Comment #7
poker10 commentedAccording to my testing from #3528467: InvalidComponentException when Workspaces UI and Navigation modules are enabled , the error only appears if Workspaces UI is enabled. It is not sufficient to enable just Navigation and Workspaces to trigger the error. So I am updating the title and adjusting the priority as it is pretty easy tu run into this. Adding this issue as navigation stable blocker instead of my duplicate issue.
Comment #8
jatingupta40 commentedTotally agreed with @poker10.
There seems to be something that workspaces_ui module is passing a NULL or maybe missing to pass to navigation module that expects value for #icon.
Because when i uninstalled the navigation module. There is no error and site working fine.
Looking forward around the cause of the issue.
Comment #9
catchThis seems critical for navigation module.
Comment #10
catchThis could use a basic integration test where we install workspaces and workspaces_ui alongside navigation module and hit a page with an admin user or something. If there is actual integration to test we could try to test that too, but that could also be a follow-up.
Comment #14
amateescu commentedOpened a MR with the fix and tests :)
Comment #15
rkollernice thank you! I've manually tested the MR12310, and i can confirm that the WSOD is gone when I am installing workspaces and workspaces_ui. also tested step wise uninstalling. everything works fine (
only noticed a color contrast issue on the confirmation dialog for switching the workspace - will check existing issues later and in case file an follow up, after it is clearly out of the scope for this issue*unable to reproduce the problem anymore, looks all good now ). i'll leave the issue at needs review since i am not able to review the actual code.Comment #16
jatingupta40 commentedThe MR #11 has been applied successfully and is working as expected.
After enabling all three modules — Workspace UI, Workspace, and Navigation — the site is functioning smoothly without any errors.
Attached video for reference.

Comment #17
plopescCode looks very good, tests are green and tested locally with no issues.
Marking as RTBC.
Thank you!
Comment #20
catchCommitted/pushed to 11.x and cherry-picked to 11.2.x, thanks!