By hugovk on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
8.8.x
Introduced in version:
Issue links:
Description:
Summary
When the entity label changes, invalidate the breadcrumb render cache so the new label is shown in the breadcrumbs.
Before
use Drupal\Core\Controller\TitleResolverInterface;
TitleResolverInterface $title_resolver;
$title = $title_resolver->getTitle($route_request, $route_match->getRouteObject());
After
use Drupal\Core\Controller\CacheableTitleResolverInterface;
CacheableTitleResolverInterface $title_resolver;
$cacheable_title = $title_resolver->getCacheableTitle($route_request, $route_match->getRouteObject());
$breadcrumb->addCacheableDependency($cacheable_title);
$title = $cacheable_title->getTitle();
Impacts:
Site builders, administrators, editors