Loading core/modules/book/src/BookBreadcrumbBuilder.php +3 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\Core\Breadcrumb\Breadcrumb; use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageInterface; Loading Loading @@ -70,7 +71,8 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Acc /** * {@inheritdoc} */ public function applies(RouteMatchInterface $route_match) { public function applies(RouteMatchInterface $route_match, ?CacheableMetadata $cacheable_metadata = NULL) { $cacheable_metadata?->addCacheContexts(['route.book_navigation']); $node = $route_match->getParameter('node'); return $node instanceof NodeInterface && !empty($node->book); } Loading Loading
core/modules/book/src/BookBreadcrumbBuilder.php +3 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\Core\Breadcrumb\Breadcrumb; use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageInterface; Loading Loading @@ -70,7 +71,8 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Acc /** * {@inheritdoc} */ public function applies(RouteMatchInterface $route_match) { public function applies(RouteMatchInterface $route_match, ?CacheableMetadata $cacheable_metadata = NULL) { $cacheable_metadata?->addCacheContexts(['route.book_navigation']); $node = $route_match->getParameter('node'); return $node instanceof NodeInterface && !empty($node->book); } Loading