Closed (fixed)
Project:
Menu Breadcrumb
Version:
2.0.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2021 at 13:54 UTC
Updated:
18 Nov 2025 at 21:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
nicxvan commented@greg-boggs pointed me at a similar solution in easy breadcrumb. If this gets merged please include him in the credit.
Comment #5
nicxvan commentedHere is a patch file for deployments
Comment #6
sutharsan commentedThis comment gives me an uncomfortable feeling, it sounds like a hack to me. Do we understand why the bug occurs?
Comment #7
sutharsan commentedIt would be beneficial to have at least the steps to reproduce the problem, i.e. which Drupal setup. Some suggestion: Interface translation y/n, content translation y/n, menu translatable y/n, menu-items translatable y/n, url alias differs per language y/n, active trail differs per language y/n
I don't experience the problem in my set-up (yet), but I do have collected the cache contexts of the breadcrumb block (used renderviz module):
Comment #8
nicxvan commentedThank you for responding, I am not sure what you mean about the change being unrelated.
It is a bit hard to reproduce but I will answer your questions.
We do have some interface translation but not for breadcrumbs.
Content, menu, menu items are all translated.
The url alias is the same on both languages, but we use the path '/es' to handle language negotiation.
The active trail is the same on both.
Comment #9
nicxvan commentedThis may not be related to the languages. I found a core bug that has the exact same behavior:
https://www.drupal.org/project/drupal/issues/2875276
If I clear the cache while on the home page then no breadcrumbs ever show up.
Comment #10
renatog commented@nicxvan do you know the steps to "how to reproduce" that?
I have a similar issue that that breadcrumb doesn't appear in some languages in production, but is working fine locally. I have a guess that is related to memcached. But I'm not really sure. I'm curious because seems to be similar
Comment #11
nicxvan commented@renatoG I've never been able to fully pin down the cause. We don't use Memcache anymore so it's not likely related to that.
Comment #12
stefan.kornI also experienced this issue, little different. All of a sudden menu breadcrumb stopped working. Finally found out that it was related to facet pretty paths and Search API. There was a node that had the same URL Alias as a search display. As soon as I renamed the node and cleared the cache, menu breadcrumb was working again.
It seemed that facet pretty paths somehow added its query parameters to all node requests and thus menu breadcrumb did not find itself responsible anymore (applies method) for any nodes. Strange enough that this kills all node breadcrumbs ...
Comment #13
phjouI am also experiencing something similar, but in case I identified that the breadcrumb breaks everytime I visit a node.Example:-- Visit custom route, breadcrumb show
-- Visit node
-- Visit same custom route, breadcrumb disappears
And I need to flush the cache in order for the breadcrumb to reappear on the custom route.EDIT: was the fault of a custom preprocess that was emptying the whole content including the cache tags.
Comment #14
xurizaemonThere is a Menu Breadcrumb fix related to route parameter matching in #3392139: Wrong breadcrumb due to route alterations which might be of interest. Thanks for linking #2875276: Breadcrumbs disappears when starting with front-page after cache rebuild (for anonymous user). as well Nic.
Comment #15
duaelfrI faced this issue too but a bit different as it was not language related but user related.
I think I found steps to reproduce and the underlying cause of this.
Steps to reproduce
Current results:
Note: [Home] only shows if breadcrumbs are configured that way. If they are not, the breadcrumb just disappear.
Why is that?
This seems to be related to the way Core caches its own breadcrumbs. The way Core builds its breadcrumbs only needs to know the parent path of the current page. That's why they declare
url.path.parentas a cache context and noturl.pathlike Menu Breadcrumb does. What happens is that if you first load a page where the breadcrumb is not managed by Menu Breadcrumb, then the breadcrumb block will be held in cache for every other pages sharing the same parent path. While usingurl.path.parentis a nice optimization in the Core's breadcrumbs management, it's what's causing our issue here.Comment #17
duaelfrAs you can see in !22, the fix is quite simple and I believe it would also fix the original issue explained in the IS.
Comment #18
nicxvan commentedMy god, all this time...
I'll add this to the site and test.
Comment #19
cyu commentedI was tasked with debugging some quirky breadcrumb issues this week, and I wasn't able to reliably replicate the problem until I came across the details in #15. With that info, I was able to get my local site into the state of having invalid breadcrumbs and can confirm that the fix in !22 has resolved my issues.
@duaelfr: Thanks for the patch and the detailed explanation. The timing of cache clears, our menu structure, and the order of pages visited meant that we hadn't been seeing this outside of production, but what you've described aligns with what I'm seeing (not related to language).
Comment #20
nicxvan commentedThis looks great!
RTBC also hid the old MR that didn't work for me.
Comment #22
nicxvan commentedOn second thought you probably want to vary on language and route too.
If someone wants to make that change I can test and preserve my ability to RTBC
Comment #23
greg boggsAdding a patch of the current MR for testing purposes
Comment #24
nicxvan commented@greg-boggs let me know on slack he tested that context and it is not needed.
RTBC again
Comment #25
nicxvan commentedComment #26
ben.hamelinGood morning! Just chiming in here, this fixed an issue we were dealing with where the breadcrumb was being driven by the assignment to a Group. Alias was derived from the group path, but breadcrumb was being cached. Thanks everyone!
Comment #28
xurizaemonThanks all! And thanks @nicxvan for the nudge to land this.
Comment #30
nicxvan commentedComment #31
greg boggsLooks good.