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

CommentFileSizeAuthor
#16 core_12310.mov1.02 MBjatingupta40
#5 3523705-5.patch973 bytesrhezios

Issue fork drupal-3523705

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

rkoller created an issue. See original summary.

catch’s picture

Component: workspaces.module » navigation.module

Moving this to navigation module.

rhezios made their first commit to this issue’s fork.

rhezios’s picture

StatusFileSize
new973 bytes

The 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

libbna’s picture

Is the work still is progress? Because I applied the patch and checked, I am still getting the error.

poker10’s picture

Title: InvalidComponentException when workspaces and workspaces ui is installed » InvalidComponentException when workspaces ui is installed
Issue summary: View changes
Priority: Normal » Major
Issue tags: +Navigation stable blocker

According 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.

jatingupta40’s picture

Totally 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.

catch’s picture

Priority: Major » Critical

This seems critical for navigation module.

catch’s picture

Issue tags: +Needs tests

This 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.

amateescu made their first commit to this issue’s fork.

amateescu’s picture

Status: Active » Needs review
Issue tags: -Needs tests

Opened a MR with the fix and tests :)

rkoller’s picture

nice 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.

jatingupta40’s picture

StatusFileSize
new1.02 MB

The 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.
Only local images are allowed.

plopesc’s picture

Status: Needs review » Reviewed & tested by the community

Code looks very good, tests are green and tested locally with no issues.

Marking as RTBC.

Thank you!

  • catch committed 9645d13b on 11.2.x
    Issue #3523705 by amateescu, rkoller, poker10: InvalidComponentException...

  • catch committed 9637a9a8 on 11.x
    Issue #3523705 by amateescu, rkoller, poker10: InvalidComponentException...
catch’s picture

Version: 11.x-dev » 11.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.2.x, thanks!

Status: Fixed » Closed (fixed)

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