diff --git a/core/core.services.yml b/core/core.services.yml index 5355141..3c27130 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -491,7 +491,7 @@ services: - [setContext, ['@?router.request_context']] unrouted_url_assembler: class: Drupal\Core\Utility\UnroutedUrlAssembler - arguments: ['@path_processor_manager', '@request_stack', '@config.factory'] + arguments: ['@request_stack', '@config.factory' ] link_generator: class: Drupal\Core\Utility\LinkGenerator arguments: ['@url_generator', '@module_handler'] diff --git a/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php b/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php index dd267d9..08d0083 100644 --- a/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php +++ b/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php @@ -10,7 +10,6 @@ use Drupal\Component\Utility\String; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\PathProcessor\OutboundPathProcessorInterface; use Symfony\Component\HttpFoundation\RequestStack; /** @@ -21,13 +20,6 @@ class UnroutedUrlAssembler implements UnroutedUrlAssemblerInterface { /** - * The path processor to convert the system path to one suitable for urls. - * - * @var \Drupal\Core\PathProcessor\OutboundPathProcessorInterface - */ - protected $pathProcessor; - - /** * A request stack object. * * @var \Symfony\Component\HttpFoundation\RequestStack @@ -37,17 +29,14 @@ class UnroutedUrlAssembler implements UnroutedUrlAssemblerInterface { /** * Constructs a new unroutedUrlAssembler object. * - * @param \Drupal\Core\PathProcessor\OutboundPathProcessorInterface $path_processor - * The path processor to convert the system path to one suitable for urls. * @param \Drupal\Core\Config\ConfigFactoryInterface $config * The config factory. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * A request stack object. */ - public function __construct(OutboundPathProcessorInterface $path_processor, RequestStack $request_stack, ConfigFactoryInterface $config) { + public function __construct(RequestStack $request_stack, ConfigFactoryInterface $config) { $allowed_protocols = $config->get('system.filter')->get('protocols') ?: ['http', 'https']; UrlHelper::setAllowedProtocols($allowed_protocols); - $this->pathProcessor = $path_processor; $this->requestStack = $request_stack; } @@ -110,7 +99,6 @@ protected function buildLocalUrl($uri, array $options = []) { // Remove the base:// scheme. $uri = substr($uri, 7); - $uri = $this->pathProcessor->processOutbound(trim($uri, '/'), $options, $this->requestStack->getCurrentRequest()); // Add any subdirectory where Drupal is installed. $current_base_path = $request->getBasePath() . '/'; diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 2930fcb..bac4428 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -258,7 +258,7 @@ function shortcut_renderable_links($shortcut_set = NULL) { $shortcut = \Drupal::entityManager()->getTranslationFromContext($shortcut); $links[] = array( 'title' => $shortcut->label(), - 'url' => Url::fromUri('base://' . $shortcut->path->value), + 'url' => Url::fromRoute($shortcut->route_name->value, $shortcut->route_parameters->value), ); $cache_tags = Cache::mergeTags($cache_tags, $shortcut->getCacheTag()); } diff --git a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php index d24e1f0..03b3375 100644 --- a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php @@ -47,11 +47,7 @@ protected function setUp() { $this->requestStack = new RequestStack(); $this->configFactory = $this->getConfigFactoryStub(['system.filter' => []]); - $path_processor = $this->getMock('Drupal\Core\PathProcessor\OutboundPathProcessorInterface'); - $path_processor->expects($this->any()) - ->method('processOutbound') - ->willReturnArgument(0); - $this->unroutedUrlAssembler = new UnroutedUrlAssembler($path_processor, $this->requestStack, $this->configFactory); + $this->unroutedUrlAssembler = new UnroutedUrlAssembler($this->requestStack, $this->configFactory); } /**