diff --git a/core/core.services.yml b/core/core.services.yml index b1c141d..8de5f30 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -311,12 +311,12 @@ services: url_generator.uncached: class: Drupal\Core\Routing\UrlGenerator arguments: ['@router.route_provider', '@path_processor_manager', '@route_processor_manager', '@config.factory', '@settings'] - url_generator: - class: Drupal\Core\Routing\CachedUrlGenerator - arguments: ['@url_generator.uncached', '@cache.url_generator', '@language_manager'] calls: - [setRequest, ['@?request']] - [setContext, ['@?router.request_context']] + url_generator: + class: Drupal\Core\Routing\CachedUrlGenerator + arguments: ['@url_generator.uncached', '@cache.url_generator', '@language_manager'] link_generator: class: Drupal\Core\Utility\LinkGenerator arguments: ['@url_generator', '@module_handler'] diff --git a/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php b/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php index 1cdd9ca..d73b769 100644 --- a/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php @@ -151,7 +151,7 @@ public function setRequest(Request $request) { $this->cacheKey = $request->attributes->get('_system_path'); // Only multilingual sites have language dependant URLs. if ($this->languageManager->isMultilingual()) { - $this->cacheKey .= '::' . $this->languageManager->getLanguage(Language::TYPE_URL)->id; + $this->cacheKey .= '::' . $this->languageManager->getLanguage(Language::TYPE_URL)->getId(); } $cached = $this->cache->get($this->cacheKey); if ($cached) { diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php index 9f9057a..8d2fbca 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php @@ -10,7 +10,7 @@ use Drupal\Core\Entity\EntityFormController; use Drupal\Core\Language\Language; use Drupal\Core\Path\AliasManagerInterface; -use Drupal\Core\Routing\UrlGenerator; +use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\menu_link\MenuLinkStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -50,7 +50,7 @@ class MenuLinkFormController extends EntityFormController { * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator * The URL generator. */ - public function __construct(MenuLinkStorageInterface $menu_link_storage, AliasManagerInterface $path_alias_manager, UrlGenerator $url_generator) { + public function __construct(MenuLinkStorageInterface $menu_link_storage, AliasManagerInterface $path_alias_manager, UrlGeneratorInterface $url_generator) { $this->menuLinkStorage = $menu_link_storage; $this->pathAliasManager = $path_alias_manager; $this->urlGenerator = $url_generator;