diff --git a/core/lib/Drupal/Core/Path/CurrentPath.php b/core/lib/Drupal/Core/Path/CurrentPath.php index 5239ad5..6dcbb14 100644 --- a/core/lib/Drupal/Core/Path/CurrentPath.php +++ b/core/lib/Drupal/Core/Path/CurrentPath.php @@ -12,13 +12,13 @@ * Represents the current path for the current request. * * Note: You should not rely on paths but better on route names / parameters or - * other indicators like context. For some fundamental parts, like routing / - * path processing, there is though no way around dealing with paths. + * other indicators like context. For some fundamental parts, like routing or + * path processing, there is unfortunately no way around dealing with paths. */ class CurrentPath { /** - * Internal cache of paths. + * Static cache of paths. * * @var \SplObjectStorage */ diff --git a/core/lib/Drupal/Core/RouteProcessor/RouteProcessorCurrent.php b/core/lib/Drupal/Core/RouteProcessor/RouteProcessorCurrent.php index 7a0023f..1a00b21 100644 --- a/core/lib/Drupal/Core/RouteProcessor/RouteProcessorCurrent.php +++ b/core/lib/Drupal/Core/RouteProcessor/RouteProcessorCurrent.php @@ -46,7 +46,7 @@ public function processOutbound($route_name, Route $route, array &$parameters) { } else { // If we have no current route match available, point to the frontpage. - $route->setPath(''); + $route->setPath('/'); } } } diff --git a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php index 7265769..8d6cb65 100644 --- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php +++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php @@ -219,7 +219,7 @@ private function formSubmitHelper($form, $edit) { $edit['form_id'] = $form_id; // Disable page redirect for forms submitted programmatically. This is a - // solution to skip redirect step (there are no pages, then the redirect + // solution to skip the redirect step (there are no pages, then the redirect // isn't possible). $form_state->disableRedirect(); $form_state->setUserInput($edit); diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php b/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php index bb66f59..ecf1e3a 100644 --- a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php +++ b/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php @@ -108,6 +108,7 @@ public function testProcessOutbound() { $request_stack->push($request); $request_context->fromRequest($request); + // In case we have to routing, the current route should point to the front. $this->assertEqual('/', \Drupal::url('')); } diff --git a/core/modules/system/src/Tests/Routing/RouteProviderTest.php b/core/modules/system/src/Tests/Routing/RouteProviderTest.php index d939e6f..d74fbd5 100644 --- a/core/modules/system/src/Tests/Routing/RouteProviderTest.php +++ b/core/modules/system/src/Tests/Routing/RouteProviderTest.php @@ -355,7 +355,7 @@ function testOutlinePathNoMatch() { } /** - * Ensures that a manual test current path overrides the request path. + * Ensures a path set on the current path services overrides the request one. */ function testCurrentPath() { $connection = Database::getConnection(); diff --git a/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php b/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php index 01fa88f..788f35a 100644 --- a/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php +++ b/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php @@ -41,7 +41,6 @@ public function __construct(RouteMatchInterface $current_route_match) { $this->currentRouteMatch = $current_route_match; } - /** * Generates themed output early in a page request. *