diff --git a/core/modules/book/book.services.yml b/core/modules/book/book.services.yml index 06affbb..0928d4a 100644 --- a/core/modules/book/book.services.yml +++ b/core/modules/book/book.services.yml @@ -26,8 +26,8 @@ services: cache_context.route.book_navigation: class: Drupal\book\Cache\BookNavigationCacheContext arguments: ['@request_stack'] - calls: - - [setContainer, ['@service_container']] + # @todo Remove in https://www.drupal.org/node/2550447. + parent: container.trait tags: - { name: cache.context} diff --git a/core/modules/book/src/Cache/BookNavigationCacheContext.php b/core/modules/book/src/Cache/BookNavigationCacheContext.php index d165b95..f720484 100644 --- a/core/modules/book/src/Cache/BookNavigationCacheContext.php +++ b/core/modules/book/src/Cache/BookNavigationCacheContext.php @@ -65,6 +65,7 @@ public function getContext() { return 'book.none'; } + // @todo Inject the book.manager in https://www.drupal.org/node/2550447. // If we're looking at a book node, get the trail for that node. $active_trail = $this->container->get('book.manager') ->getActiveTrailIds($node->book['bid'], $node->book);