diff --git a/core/modules/taxonomy/src/TermBreadcrumbBuilder.php b/core/modules/taxonomy/src/TermBreadcrumbBuilder.php index 1c32b41..65f41fe 100644 --- a/core/modules/taxonomy/src/TermBreadcrumbBuilder.php +++ b/core/modules/taxonomy/src/TermBreadcrumbBuilder.php @@ -27,10 +27,18 @@ class TermBreadcrumbBuilder implements BreadcrumbBuilderInterface { protected $entityManager; /** + * The taxonomy storage. + * + * @var \Drupal\Core\Entity\EntityStorageInterface + */ + protected $termStorage; + + /** * Setup the entity manager. */ public function __construct(EntityManagerInterface $entityManager) { $this->entityManager = $entityManager; + $this->termStorage = $entityManager->getStorage('taxonomy_term'); } /** @@ -50,7 +58,7 @@ public function build(RouteMatchInterface $route_match) { // hard-coded presumption. Make this behavior configurable per // vocabulary or term. $breadcrumb = array(); - while ($parents = $this->entityManager->getStorage('taxonomy_term')->loadParents($term->id())) { + while ($parents = $this->termStorage->loadParents($term->id())) { $term = array_shift($parents); $term = $this->entityManager->getTranslationFromContext($term); $breadcrumb[] = Link::createFromRoute($term->getName(), 'entity.taxonomy_term.canonical', array('taxonomy_term' => $term->id()));