diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 5d5d66a..b63856d 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -692,12 +692,13 @@ function system_js_settings_alter(&$settings, AttachedAssetsInterface $assets) { } $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' => \Drupal::service('path.matcher')->isFrontPage() ? '' : $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)) {