diff --git a/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php b/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php index 594dec7..debe9ca 100644 --- a/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php +++ b/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php @@ -8,6 +8,7 @@ namespace Drupal\system; use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; +use Drupal\Core\Entity\EntityManager; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\Access\AccessManager; use Drupal\Core\PathProcessor\InboundPathProcessorInterface; @@ -44,6 +45,13 @@ class PathBasedBreadcrumbBuilder implements BreadcrumbBuilderInterface { protected $translation; /** + * The menu storage controller. + * + * @var \Drupal\Core\Config\Entity\ConfigStorageController + */ + protected $menuStorage; + +/** * The dynamic router service. * * @var \Symfony\Component\Routing\Matcher\RequestMatcherInterface @@ -60,21 +68,22 @@ class PathBasedBreadcrumbBuilder implements BreadcrumbBuilderInterface { /** * Constructs the MenuLinkBreadcrumbBuilder. * - * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider - * The route provider service. + * @param \Symfony\Component\HttpFoundation\Request $request + * The current Request object. * @param \Drupal\Core\Entity\EntityManager $entity_manager * The entity manager service. * @param \Drupal\Core\Access\AccessManager $access_manager * The menu link access service. * @param \Drupal\Core\StringTranslation\TranslationInterface $translation * The translation manager service. - * @param \Symfony\Cmf\Component\Routing\DynamicRouter $dynamic_router - * The dynamic router service. + * @param \Drupal\Core\PathProcessor\InboundPathProcessorInterface $path_processor + * The inbound path processor. */ - public function __construct(Request $request, AccessManager $access_manager, TranslationInterface $translation, RequestMatcherInterface $router, InboundPathProcessorInterface $path_processor) { + public function __construct(Request $request, EntityManager $entity_manager, AccessManager $access_manager, TranslationInterface $translation, RequestMatcherInterface $router, InboundPathProcessorInterface $path_processor) { $this->request = $request; $this->accessManager = $access_manager; $this->translation = $translation; + $this->menuStorage = $entity_manager->getStorageController('menu'); $this->router = $router; $this->pathProcessor = $path_processor; } diff --git a/core/modules/system/system.services.yml b/core/modules/system/system.services.yml index 93f0191..36fe8eb 100644 --- a/core/modules/system/system.services.yml +++ b/core/modules/system/system.services.yml @@ -12,7 +12,7 @@ services: - {name: breadcrumb_builder, priority: 500} system.breadcrumb.default: class: Drupal\system\PathBasedBreadcrumbBuilder - arguments: ['@request', '@access_manager', '@string_translation', '@router', '@path_processor_manager'] + arguments: ['@request', '@plugin.manager.entity', '@access_manager', '@string_translation', '@router', '@path_processor_manager'] tags: - { name: breadcrumb_builder, priority: 0 } path_processor.files: