I currently have the same issue on 10.3.10 and patch #2 solved it. The bug on my website was fixed by adding the "url" in addition to the "url.path" that was already included in the context.
I have a breadcrumb block, displayed within a hero block, which is in turn rendered inside the view template.
- I created 2 views A and B and enabled ajax for both of them.
- I added an exposed filter "Category" for view A and an exposed filter "Theme" for view B .
- I have a custom hero block created in a separate module that renders both the page title and the breadcrumb.
block template :
{{ hero_heading }}
{{ drupal_block('system_breadcrumb_block') }}
- In the view template, I call this hero block using:
{%
set classes = [
dom_id ? 'js-view-dom-id-' ~ dom_id,
]
%}
<div{{ attributes.addClass(classes) }}>
{{ title_prefix }}
{{ title }}
{{ title_suffix }}
{{ drupal_entity('block', 'test_heroblock', check_access=false) }}
- When I navigate to the path of view A, I get the correct page title in the breadcrumb which is Page A.
- I then filter using the exposed filter "Category". This is where ajax is being triggered and the hero block is rendered again and this time the breadcrumb also displays the right title which is "Page A".
- I then visit the path of view B, and initially, I get the correct page title which is Page B. However, when I filter using the exposed filter "Theme", ajax is triggered and the breadcrumb is rendered again but this time it displays the wrong title: "Page A" instead of "Page B", as if whenever views/ajax is detected, the cached title will always be "Page A".
Adding "url" solved it.
rchallita β created an issue.
rchallita β made their first commit to this issueβs fork.