diff options
-rw-r--r-- | modules/translation/translation.module | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/translation/translation.module b/modules/translation/translation.module index 2fc84e770..c6edf6744 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -384,7 +384,7 @@ function translation_node_get_translations($tnid) { if (!isset($translations[$tnid])) { $translations[$tnid] = array(); $result = db_select('node', 'n') - ->fields('n', array('nid', 'title', 'language')) + ->fields('n', array('nid', 'type', 'uid', 'status', 'title', 'language')) ->condition('n.tnid', $tnid) ->addTag('node_access') ->execute(); @@ -435,8 +435,11 @@ function translation_path_get_translations($path) { */ function translation_language_switch_links_alter(array &$links, $type, $path) { if ($type == LANGUAGE_TYPE_INTERFACE && $paths = translation_path_get_translations($path)) { + $path = explode('/', $path); + $node = node_load($path[1]); + $translations = translation_node_get_translations($node->tnid); foreach ($links as $langcode => $link) { - if (isset($paths[$langcode])) { + if (isset($paths[$langcode]) && $translations[$langcode]->status) { // Translation in a different node. $links[$langcode]['href'] = $paths[$langcode]; } |