Hi,

I have a vocabulary called "Blog topics". "Blog topics" terms are common to all languages so they are i18n localized.
I set up a condition of type Taxonomy Term and I checked "Blog topics"
I set up a reaction of type Blocks and I added a few blocks on my sidebar second.
The blocks appear when I visited the term's page in the source language but not when I visit it in a localized language.

Let me know if you need more info to reproduce the bug !

Bye

Comments

ykyuen’s picture

Version: 7.x-3.0-beta4 » 7.x-3.0-beta6

I am having exactly the same problem with 7.x-3.0-beta6.

nicolas bouteille’s picture

What I did personally in the mean time is set up a condition of type Path on "blog/*" and "blogue/*" instead.

h3rj4n’s picture

It took some time to figure this out but the problem lays in the following:

/**
 * Implementation of hook_entity_prepare_view().
 */
function context_entity_prepare_view($prepare, $entity_type) {
  if ($entity_type === 'taxonomy_term' && count($prepare) === 1) {
    $term = reset($prepare);
    if ($term === menu_get_object('taxonomy_term', 2) && $plugin = context_get_plugin('condition', 'taxonomy_term')) {
      $plugin->execute($term, 'view');
    }
  }
}

The context is only attached when the $term object meets the menu_get_object value. In my case the menu_get_object function returns the following:
context-taxonomy_lang_en.png
This will be compared with:
context-taxonomy_lang_ru.png

As you can see the term object that is provided to the hook contains the translated name. The object fetched with menu_get_object is not translated. I would suggest not to check on the entire object, but only on the term id. The code is only executed on the taxonomy entity so the ID should be unique for this entity.

I applied a patch to add this to the context module.

h3rj4n’s picture

Status: Active » Needs review

Forgot to set it to 'needs review'

tekante’s picture

Status: Needs review » Fixed

Committed with commit 16aa5aeed85626b3f189316ef2717f6a2d982d15. Thanks for the bug report and patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.