diff -u b/core/modules/system/system.module b/core/modules/system/system.module --- b/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -692,13 +692,12 @@ } $current_path = $route_match->getRouteName() ? Url::fromRouteMatch($route_match)->getInternalPath() : ''; $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route_match->getRouteObject()); - $is_front_page = \Drupal::service('path.matcher')->isFrontPage(); $path_settings = [ 'baseUrl' => $request->getBaseUrl() . '/', 'pathPrefix' => $pathPrefix, - 'currentPath' => $is_front_page ? '' : $current_path, + 'currentPath' => $current_path, 'currentPathIsAdmin' => $current_path_is_admin, - 'isFront' => $is_front_page, + 'isFront' => \Drupal::service('path.matcher')->isFrontPage(), 'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(), ]; if (!empty($current_query)) { @@ -718,12 +717,13 @@ } $current_path = $route_match->getRouteName() ? Url::fromRouteMatch($route_match)->getInternalPath() : ''; $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route_match->getRouteObject()); + $is_front_page = \Drupal::service('path.matcher')->isFrontPage(); $path_settings = [ 'baseUrl' => $request->getBaseUrl() . '/', 'pathPrefix' => $pathPrefix, - 'currentPath' => $current_path, + 'currentPath' => $is_front_page ? '' : $current_path, 'currentPathIsAdmin' => $current_path_is_admin, - 'isFront' => \Drupal::service('path.matcher')->isFrontPage(), + 'isFront' => $is_front_page, 'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(), ]; if (!empty($current_query)) {