By chaitanyadessai on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
main
Introduced in version:
12.1.0
Issue links:
Description:
BreadcrumbManager::build() now caches the built breadcrumb in the cache.memory bin. The cache is keyed by route name and raw route parameters. A cached breadcrumb is only reused within the request it was built for.
BreadcrumbManager::__construct() has two new arguments: $memoryCache and $requestStack. Calling the constructor without them is deprecated in drupal:12.1.0. They are required in drupal:13.0.0.
Code that creates BreadcrumbManager directly, or extends it, must pass the new arguments.
Before:
$manager = new BreadcrumbManager($module_handler);
After:
$manager = new BreadcrumbManager(
$module_handler,
$container->get('cache.memory'),
$container->get('request_stack'),
);
Service definitions that extend the breadcrumb service must add the arguments:
arguments: ['@module_handler', '@cache.memory', '@request_stack']