I may have configured something wrong here, but this is the set-up:

1. A content-type with a entity reference field to a taxonomy vocabulary (field_myref)
- the field is not translatable
- the field is set to render as select list
2. The taxonomy vocabulary uses entity translation
- title module is used to replace name with name_field
3. A view which exposes field_myref in page

In English the select field looks great, but in French the English terms still appear even though the term names are translated. I am wondering is there something wrong with my config or is this a defect?

Comments

joel_osc’s picture

Status: Active » Needs review
StatusFileSize
new861 bytes

I have found something interesting...taxonomy_get_tree will return just the basic term information unless you set the entity_load flag. After which the title module will kick in and add the name_field information and change the term->name to the translated version. So this is potentially a one-line patch, except I have no idea the ramifications of doing this...maybe performance implications?

For discussion purposes, here is the patch.

chris matthews’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch to EntityReference_SelectionHandler_Generic.class.php does not apply to the latest 7.x-1.x-dev and if still relevant needs a reroll.

Checking patch plugins/selection/EntityReference_SelectionHandler_Generic.class.php...
error: while searching for:

    foreach ($bundles as $bundle) {
      if ($vocabulary = taxonomy_vocabulary_machine_name_load($bundle)) {
        if ($terms = taxonomy_get_tree($vocabulary->vid, 0)) {
          foreach ($terms as $term) {
            $options[$vocabulary->machine_name][$term->tid] = str_repeat('-', $term->depth) . check_plain($term->name);
          }

error: patch failed: plugins/selection/EntityReference_SelectionHandler_Generic.class.php:540
error: plugins/selection/EntityReference_SelectionHandler_Generic.class.php: patch does not apply