From 9dc60ce09b2d0ae801307499e437137b8407ce33 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 11 Oct 2008 23:32:07 +0000 Subject: #295626 by wuf31 and Damien Tournoud: Fix incorrect path for front page in locale_block(). --- modules/locale/locale.module | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 128197247..bc4b37070 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -590,11 +590,12 @@ function locale_block($op = 'list', $delta = '') { // Only show if we have at least two languages and language dependent // web addresses, so we can actually link to other language versions. elseif ($op == 'view' && variable_get('language_count', 1) > 1 && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) { + $path = drupal_is_front_page() ? '' : $_GET['q']; $languages = language_list('enabled'); $links = array(); foreach ($languages[1] as $language) { $links[$language->language] = array( - 'href' => $_GET['q'], + 'href' => $path, 'title' => $language->native, 'language' => $language, 'attributes' => array('class' => 'language-link'), @@ -605,7 +606,7 @@ function locale_block($op = 'list', $delta = '') { // A translation link may need to point to a different path or use // a translated link text before going through l(), which will just // handle the path aliases. - drupal_alter('translation_link', $links, $_GET['q']); + drupal_alter('translation_link', $links, $path); $block['subject'] = t('Languages'); $block['content'] = theme('links', $links, array()); -- cgit v1.2.3