Closed (fixed)
Project:
ZURB Foundation
Version:
8.x-6.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Jun 2016 at 07:31 UTC
Updated:
16 Nov 2018 at 09:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Red2015 commentedComment #3
Red2015 commentedSeems to be a cacheing issue. When I clear caches the current page and parent category seem to 'stick' with what page I was on when the cache was cleared.
Comment #4
NetNerdy commentedhi red2015...i had the same issue.
but...i have not this issue in projects after downloading and installing foundation and other modules by composer and drush - (composer NOT composer_manager)...i'm also creating the sub-theme by "drush fst ..."
edit: i'm using foundation 6.
i hope this helps something
Comment #5
samuel.mortensonWe don't make a lot of modifications with breadcrumbs, just to make sure have you tried setting Bartik as your default theme and seeing if the same issue occurs?
Comment #6
Red2015 commentedHi,
Thanks for the help. I have tried the Bartik theme and the issue does not occur here. Only on the foundation 5.
Thanks
Comment #7
dswier commentedThis appears to be the same issue that is described in https://www.drupal.org/node/2483183#comment-11185583, comments 197 and 198. I was able to reproduce by visiting an article node, then creating a new article node and saving it. The new node then had the breadcrumb of the previous article I was viewing.
According to the thread I referenced:
I am honestly not sure what adding the correct cacheability metadata would entail, but I thought this information was relevant and worth sharing.
Comment #8
Red2015 commentedThanks for sharing dswier. As you say, it doesn't really open up very much what actually needs to happen, but glad to see others have picked on it!
Comment #9
borisson_So, the problem here is that an additional item is added to the breadcrumb that is different per url but this block does not have per-block cache context. This can be fixed by adding the correct cache context.
Comment #10
wim leersAFAICT you actually want the 'route' cache context, not the 'url' one.
Comment #11
wim leersComment #12
wim leersComment #13
borisson_So, for now this solution works, but we should change url to route context and see if that also still works. Ideally the entity's cache tags are added here as well.
Because the block no longer displays incorrect information when navigating between nodes, this should be sufficient for the needs I have on this project. I'll try to make time to add the entity cache tags in my own time tonight.
Comment #14
borisson_This is an imperfect solution but it should be more correct, I think.
Comment #15
hongpong commented@borisson_ I am seeing some breadcrumb issues right now and going to try patch 14, can you explain a little more about the imperfections of your patch? :) Thanks!
Comment #16
hongpong commentedRe rolled the patch, should apply to head now. I still get problems with the node titles not caching correctly, basic pages in particular the cache tag is just not right. I don't know too much about cacheability but perhaps someone with more experience knows the right thing to do here.
Comment #17
borisson_#15: The problem with that patch is that this might not work for entities that don't set
_entityon the route. I think most entities do that now, so this should work.Comment #18
hongpong commentedHmm it didn't work for me - I'm not familiar with this area so I'm just going to comment out everything in the preprocess function and try using https://www.drupal.org/project/easy_breadcrumb instead. That module has 8k+ sites in D8 so maybe it will be a viable replacement.
Patch disabling everything in zurb_foundation_preprocess_breadcrumb attached.
Comment #19
arosboro commentedI looked into this issue and various solutions and decided to follow a similar patch that bootstrap used in https://www.drupal.org/node/2722093.
I had initially thought to just use the cache tag 'url' however the other developer applied it as a context rather than a cache tag.
EDIT: Seeing now that this was the initial approach of the first patch, I may be motivated to change 'url' to 'route' if that is more correct.
Comment #20
kevinquillen commentedShould it be
url.path? On sites where I am either theming or altering the breadcrumb, I add:or
Both work for me.
On a project where I had to implement my own Breadcrumb Builder class, I had to add this (to trigger a change when the node changed):
Though I am not sure of the equivalent for the
.themefile for that one.Comment #21
Anonymous (not verified) commentedCan verify that #16 is a good solution for the time being.
Also experience the same issue only with Zurb Foundation 8.x-6.x and my Sub Theme created from it.
When switching back to Bartik, the Breadcrumbs issue goes away.
Comment #22
philosurfer commented#16 is not working..
creates the following error
Error: Call to a member function getCacheTags() on null in /app/web/themes/contrib/zurb_foundation/zurb_foundation.theme on line 32Comment #23
philosurfer commented[#19] is working for us..
added this under extra for the composer users:
Comment #24
anybodyConfirming RTBC for #19. There are also other themes with this problem, for example see #2817953: Breadcrumbs are cached
Comment #25
anybodyComment #27
hongpong commentedThanks everyone for looking into this. I think the #19 patch most closely solves the problem and doesn't make matters worse. Please re-open the issue if it doesn't work for you (or file a new issue if it is significantly different)
Comment #29
anybody@HongPong, thank you very much. Is there a plan for a new stable release? The patch doesn't apply on dev anymore and a new stable is missing, it would be great to have a new stable release because this issue leads to a mad hidden bug :)
Thank you!
Comment #30
anybodySorry for the trouble, the patch works with the latest alpha. But of course it's still a problem for users evaluating the theme without the patch.