Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
After deploying breadcrumbs will break depending on which language is visited first. E.g. if you visit about on spanish first after deploying then the spanish breadcrumb will be correct, but the english breadcrumb will be just `Home` This also happens in reverse if the english site is visited first after a deploy.
Clearing the cache in the ui fixes the breadcrumbs for both languages at least temporarily
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | menuBreadcrumbLanguageSupport-3230481-5.patch | 1.2 KB | nicxvan |
Issue fork menu_breadcrumb-3230481
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 #3
nicxvan CreditAttribution: 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 CreditAttribution: nicxvan commentedHere is a patch file for deployments
Comment #6
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedThis comment gives me an uncomfortable feeling, it sounds like a hack to me. Do we understand why the bug occurs?
Comment #7
Sutharsan CreditAttribution: Sutharsan at LimoenGroen 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 CreditAttribution: 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 CreditAttribution: 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@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 CreditAttribution: 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.