I found a problem with node taxonomy condition used in multilingual site. It is possible that node language is different than field language which makes this condition fail. The problem is in context_condition_node_taxonomy.inc file around line 54:

if (isset($node->{$field}[$node->language])) {
  foreach ($node->{$field}[$node->language] as $term) {

The language should rather be set by using field_language function like this:

$language = field_language('node', $node, $field);
  if (isset($node->{$field}[$language])) {
    foreach ($node->{$field}[$language] as $term) {

This fixed the problem for me. Here's the patch:

CommentFileSizeAuthor
node_taxonomy_field_language.patch872 bytesphilipz

Comments

philipz’s picture

Status: Active » Needs review
valderama’s picture

had the same problem :) took some time to find it, and I just wanted to provide a patch.

So I also hope this problem will be fixed soon.

Thx and greets,
walter

p4trizio’s picture

Thanks philipz, patch is working fine

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense.

bojanz’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

#1267372: node taxonomy condition failing on translated or multilanguage site is older and has the same fix. Marking this issue as duplicate.