Problem/Motivation
- The rigel_preprocess_breadcrumb() appends the page title to the end of the trail. In Drupal, breadcrumbs are cached based on the parent breadcrumb item.
- So if the path is:
Home / Parent 1 / Page title, the breadcrumb is cached fromHome / Parent 1. Then if we go to another page that looks likeHome / Parent 1 / Page title 2, since the caching happens atParent 1, we'll seeHome / Parent 1 / Page titleinstead ofHome / Parent 1 / Page title 2 - To get around this because we have Page title in the breadcrumb trail, we need to set the following
$variables['#cache']['contexts'][] = 'url.path';inrigel_preprocess_breadcrumb() - This changed happened in Drupal 8: https://www.drupal.org/node/2699627. To make sure we don't blow up the cache too much, we should only set the cache context if the page isn't a 404.
Issue fork rigel-3386029
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 #2
baldwinlouie commentedComment #4
baldwinlouie commented@yas, please review this patch.
Comment #5
yas@baldwinlouie
Thank you for the issue. I'll merge the patch to
5.xand6.x, and close this issue as Fixed.Comment #8
yas