diff --git a/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php b/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php index c6012a7..83d5a49 100644 --- a/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/CachedUrlGenerator.php @@ -92,7 +92,7 @@ protected function writeCache() { public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) { // We can only cache the url if $name is a string, not the actual route // object. - $parameter_hash = hash('sha256', serialize($parameters)); + $parameter_hash = hash('sha256', serialize($parameters)) . (string) $referenceType; if (is_scalar($name) && isset($this->cachedUrls[self::ROUTE_CACHE_PREFIX . $name . $parameter_hash])) { return $this->cachedUrls[self::ROUTE_CACHE_PREFIX . $name . $parameter_hash]; } 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 8eb4458..8ac4bb7 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php @@ -12,7 +12,7 @@ use Drupal\Core\Language\Language; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Path\AliasManagerInterface; -use Drupal\Core\Routing\UrlGenerator; +use Drupal\Core\Routing\PathBasedGeneratorInterface; use Drupal\menu_link\MenuLinkStorageControllerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -38,19 +38,23 @@ class MenuLinkFormController extends EntityFormController implements EntityContr /** * The URL generator. * - * @var \Drupal\Core\Routing\UrlGenerator + * @var \Drupal\Core\Routing\PathBasedGeneratorInterface */ protected $urlGenerator; /** * Constructs a new MenuLinkFormController object. * - * @param \Drupal\Core\Extension\ModuleHandlerInterface + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler service. + * @param MenuLinkStorageControllerInterface $menu_link_storage_controller + * The menu link storage controller * @param \Drupal\Core\Path\AliasManagerInterface $path_alias_manager * The path alias manager. + * @param \Drupal\Core\Routing\PathBasedGeneratorInterface $url_generator + * The url generator. */ - public function __construct(ModuleHandlerInterface $module_handler, MenuLinkStorageControllerInterface $menu_link_storage_controller, AliasManagerInterface $path_alias_manager, UrlGenerator $url_generator) { + public function __construct(ModuleHandlerInterface $module_handler, MenuLinkStorageControllerInterface $menu_link_storage_controller, AliasManagerInterface $path_alias_manager, PathBasedGeneratorInterface $url_generator) { parent::__construct($module_handler); $this->menuLinkStorageController = $menu_link_storage_controller; $this->pathAliasManager = $path_alias_manager;