Hi @all,

I just mentioned that the Node context plugin uses a translation_node_nid() call to determine if there is a translation of the node used in the context (around line 48 of plugins/contexts/node.inc):

if (module_exists('translation')) {
  if ($translation = module_invoke('translation', 'node_nid', $nid, $GLOBALS['language']->language)) {
    $nid = $translation;
    $reload = TRUE;
  }
}

This hook does not exist and this has to be used instead in order to get it working:

if (module_exists('translation')) {
  if ($translations = module_invoke('translation', 'node_get_translations', $nid)) {
    if ($translations[$GLOBALS['language']->language])  {
      $nid = $translations[$GLOBALS['language']->language]->nid;
      $reload = TRUE;
    }
  }
}

Hope this can be fixed soon?

Thanx in advance & cheers

hctom

CommentFileSizeAuthor
#1 1273050-1.patch852 bytesbenclark

Comments

benclark’s picture

StatusFileSize
new852 bytes

I ran into this issue, too, and I decided to roll a patch just in case this helps. I'm open to alternative solutions if this isn't the correct approach. I just know that when I add a specific node as a context, it won't pull in the translation automatically unless I apply this patch.

japerry’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.