Problem/Motivation
Activation of the Core Navigation and the Workspace + Workspace UI Modules crash the Drupal installation
Steps to reproduce
Install a fresh Drupal 11.1.4 Version or update from 11.1.1 to a later version
Activate Core Navigation Module
Activate Core Workspace + Workspace UI Module
Cache Error:
LogicException: The complete set of cache contexts for a variation cache item must contain all of the initial cache contexts, missing: workspace. in Drupal\Core\Cache\VariationCache->set() (line 47 of core/lib/Drupal/Core/Cache/VariationCache.php).
Drupal\Core\Render\RenderCache->set() (Line: 120)
Drupal\Core\Render\PlaceholderingRenderCache->set() (Line: 539)
Drupal\Core\Render\Renderer->doRender() (Line: 459)
Drupal\Core\Render\Renderer->doRender() (Line: 203)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 87)
__TwigTemplate_8d18a8722c1dddc77fcc95471802da02->doDisplay() (Line: 388)
Twig\Template->yield() (Line: 344)
Twig\Template->display() (Line: 359)
Twig\Template->render() (Line: 51)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 446)
Drupal\Core\Render\Renderer->doRender() (Line: 203)
Drupal\Core\Render\Renderer->render() (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() (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: 188)
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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)
Deactivate Navigation module, error is gone
I use ddev on windows wsl2 and also tried it on a fedora linux with ddev, same problem
problem startet with drupal core 11.1.2
looks like its already fixed in latest 11.x-dev build, i have no errors there
Proposed resolution
Don't use the core navigation module with core Workspace Module
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3511374-nr-bot.txt | 91 bytes | needs-review-queue-bot |
Issue fork drupal-3511374
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
robwj commentedComment #3
cilefen commentedOn the 11.x branch, currently at 93ec7a93b738f0fd, I followed the steps to reproduce. I got the following user warning, which, if it's new information, also needs looking into, but no exception. Is there an additional action or step to be taken to get the LogicException?
Comment #4
robwj commentedthe problem is in the stable versions of core since 11.1.2
i could not tag this issue to a stable version, only to 11.1.x-dev
or is there another issue site where i report issues for the stable drupal core version?
i installed a drupal 11.2-dev version from git and the error are not present, so looks like its already fixed but not in stable?
and the error comes up since 11.1.2, before i had no problems
i get the LogicException as soon as i activate the Workspaces Module after the Navigation Module
this is my workflow with ddev version v1.24.3 on windows 10 wsl2
WSL-Version: 2.4.11.0 - Kernelversion: 5.15.167.4-1 - Ubuntu 24.04.2 LTS
and than it crashes
when i deactivate the navigation module, the error is gone and i can use workspaces as expected
Unfortunately, my knowledge is currently not sufficient enough to debug the error myself
any easy tutorials to learn to debug this stuff?
Comment #5
m4oliveiI can reproduce the issue. As noted in #3 and in the issue description, it's not reproducible on 11.x. It is reproducible on the latest 11.1.x.
Will investigate further.
Comment #6
cilefen commentedgit log origin/11.1.x..origin/11.x --onelinewill show the unique commits in 11.x. Agit bisectoperation will determine the commit that changed a behavior.Comment #7
robwj commentedi think the problem is in this file
https://git.drupalcode.org/project/drupal/-/blob/11.1.2/core/modules/nav...
line 106
when i commend out the cache part, the site loads again
when i copy the navigation module from the drupal git dev version it works
but they changed a ton of other code in the module
what version gets installed when i do a git clone https://git.drupalcode.org/project/drupal.git ?
the 11.x branch?
drupal status report says 11.2-dev but i can't find this branch on git.drupalcode.org
than this version works
https://git.drupalcode.org/project/drupal/-/tree/11.x/core/modules/navig...
Comment #8
m4olivei@robwj you're close to the relevant code by not quite. It looks like there are issue with the cacheability metadata added in
\Drupal\navigation\NavigationRenderer::doBuildNavigation.Relevant issues that have collectively addressed this in 11.x are:
Apparently those were not backported to 11.1.x. I'll need to check in with some folks if we want to do that. In the meantime, I'll try and put together an MR to fix this.
Comment #10
m4oliveiI added a MR to address the cacheability issues. The problem is that the cacheability metadata collected by from API before it calls the
#pre_renderis being thrown away and overwritten. When workspaces module is enabled, this blows up due to a mismatch with expected cache contexts.As I alluded to in #8 we could alternatively address this by backporting some issues that were committed to 11.x to 11.1.x. I'm not sure what the feasibility is there. Two of the three issues were bugs. We could probably backport the two bugs without the Integrate Workspaces feature:
On 11.x this isn't an issue b/c it's not a
#pre_renderanymore, it's a#lazy_buildercallback.Comment #12
m4oliveiI also prepped an alternative MR to see how cherry-picking commits from the bug fixes would help. It does, although #3505154: NavigationRenderer manually adds required cache tags required fixing a conflict.
I think I prefer back-porting these. In which case, those relevant issues should probably be re-opened to backport. Interested in what others think.
Comment #13
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #14
catchLet's try to backport those issues to 11.1
Comment #15
ckrinaComment #16
catchI think we probably do not need this to be a navigation stable blocker because it's already fixed in 11.2.x and navigation won't be stable in 11.1.x.
Comment #17
ckrinaThanks, then I'll remove it from the Meta issue then.
Comment #18
poker10 commentedI cloned 11.x, installed standard on MySQL, enabled Navigation, enabled Workspaces+UI and still get:
The same result also on Simplytest.me.
Is this really fixed in 11.2.x?
Comment #19
catch@poker10 the original error reported here is:
This looks completely different to:
Can you open a new issue against 11.x for that maybe? That looks like it might be a regression from
a902834ced186897d/ #3516887: Allow to customize Navigation icons. At the very least, it looks like we need to add an integration test for navigation + workspaces.Comment #20
poker10 commentedOh, sorry I overlooked this. Maybe I was focused mainly to steps to reproduce and that the issue is still open, so did not read the rest correctly. Created a new issue: #3528467: InvalidComponentException when Workspaces UI and Navigation modules are enabled, but seems like the one was already there: #3523705: InvalidComponentException when workspaces ui is installed . Thanks!
Comment #21
quietone commentedIf this problem was discovered on a version of Drupal that is not 11.x, add that information in the issue summary and leave the version at 11.x. In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Also mentioned on the version section of the list of issue fields documentation.
Comment #22
catchThis was already fixed prior to Drupal 11.2's release, and Drupal 11.1 is no longer supported, so I'm going to go ahead and mark this as outdated.