Breadcrumbs disappear until cache clear for one language

Created on 30 August 2021, over 3 years ago
Updated 10 February 2023, almost 2 years ago

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

πŸ› Bug report
Status

Needs work

Version

1.16

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany stefan.korn Jossgrund

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

  • πŸ‡¨πŸ‡¦Canada phjou Vancouver πŸ‡¨πŸ‡¦ πŸ‡ͺπŸ‡Ί

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

  • Status changed to Postponed: needs info 10 months ago
  • πŸ‡³πŸ‡ΏNew Zealand xurizaemon Ōtepoti, Aotearoa 🏝

    There is a Menu Breadcrumb fix related to route parameter matching in πŸ› Wrong breadcrumb due to route alterations RTBC 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.

  • Assigned to duaelfr
  • Status changed to Needs work 5 months ago
  • πŸ‡«πŸ‡·France duaelfr Montpellier, France

    I 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

    1. Create three pages: /test1, /test2 and /test3 (paths are important)
    2. Add two pages to the main menu: [root] > test2 > test3 (test1 is not in the menu)
    3. Clear all caches
    4. Access /test1 - expected breadcrumb: [Home]
    5. Access /test2 - expected breadcrumb: [Home] > test2
    6. Access /test3 - expected breadcrumb: [Home] > test2 > test3

    Current results:

    • Breadcrumb for /test1: [Home]
    • Breadcrumb for /test2: [Home]
    • Breadcrumb for /test3: [Home]

    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.parent as a cache context and not url.path like 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 using url.path.parent is a nice optimization in the Core's breadcrumbs management, it's what's causing our issue here.

  • Issue was unassigned.
  • Status changed to Needs review 5 months ago
  • πŸ‡«πŸ‡·France duaelfr Montpellier, France

    As you can see in !22, the fix is quite simple and I believe it would also fix the original issue explained in the IS.

  • Pipeline finished with Success
    5 months ago
    Total: 150s
    #275517
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    My god, all this time...
    I'll add this to the site and test.

  • πŸ‡ΊπŸ‡ΈUnited States cYu

    I 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).

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    This looks great!

    RTBC also hid the old MR that didn't work for me.

  • Status changed to RTBC 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    nicxvan β†’ changed the visibility of the branch 3230481-breadcrumbs-disappear-until to hidden.

  • Status changed to Needs work 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    On second thought you probably want to vary on language and route too.

  • πŸ‡ΊπŸ‡ΈUnited States Greg Boggs Portland Oregon

    Adding a patch of the current MR for testing purposes

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    @greg-boggs let me know on slack he tested that context and it is not needed.

    RTBC again

  • Status changed to RTBC 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States ben.hamelin Adirondack Mountains, NY

    Good 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!

  • Pipeline finished with Skipped
    3 months ago
    #325273
  • πŸ‡³πŸ‡ΏNew Zealand xurizaemon Ōtepoti, Aotearoa 🏝

    Thanks all! And thanks @nicxvan for the nudge to land this.

  • Status changed to Fixed 2 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024