core/includes/common.inc | 2 +- core/includes/theme.inc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/includes/common.inc b/core/includes/common.inc index 935211f..a3b1910 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -2163,7 +2163,7 @@ function _drupal_add_js($data = NULL, $options = NULL) { 'currentPath' => $current_path, 'currentPathIsAdmin' => $current_path_is_admin, 'isFront' => drupal_is_front_page(), - 'currentLanguage' => \Drupal::languageManager()->getLanguage(Language::TYPE_URL)->id, + 'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_URL)->id, ); if (!empty($current_query)) { ksort($current_query); diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 0bdb15a..6a6f661 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1259,8 +1259,6 @@ function theme_links($variables) { $output .= ''; - $active_route = \Drupal::linkGenerator()->getActive(); - foreach ($links as $key => $link) { $link += array( 'href' => NULL, @@ -1287,6 +1285,9 @@ function theme_links($variables) { // only if the 'set_active_class' option is not empty. if (isset($link['href']) || isset($link['route_name'])) { if (!empty($variables['set_active_class'])) { + // Also enable set_active_class for the contained link. + $link_element['#options']['set_active_class'] = TRUE; + if (!empty($link['language'])) { $li_attributes['hreflang'] = $link['language']->id; }