When adding an entity reference field as a filter (one that refers to a taxonomy term), the terms are not translated. Render views filter as select list is enabled in the field settings.

This patch replaces $term->name with a call to entity_label.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stevel’s picture

e0ipso’s picture

milos.kroulik’s picture

Issue summary: View changes

The patch no longer apply. I will try to patch manually.

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

EDIT: Code is now completely different, will need another patch.

milos.kroulik’s picture

Status: Needs review » Active
peterpoe’s picture

Status: Active » Needs review
FileSize
910 bytes

New patch, using handler method getLabel() instead of calling directly entity_label().

chaloalvarezj’s picture

Hi there,
I have this problem in the latest stable version on entity reference (7.x-1.5), but the patch in #5 doesn't seem to apply as the code has changed.
Has anybody else found this problem recently? How to Fix it?
Thank you.

Edit: Never mind! It is working! I did not have my terms translated.. Sorry.

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch in #5 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:
      if ($vocabulary = taxonomy_vocabulary_machine_name_load($bundle)) {
        if ($terms = taxonomy_get_tree($vocabulary->vid, 0, NULL, TRUE)) {
          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:545
error: plugins/selection/EntityReference_SelectionHandler_Generic.class.php: patch does not apply
rpayanm’s picture

Status: Needs work » Needs review
FileSize
935 bytes
rpayanm’s picture

Issue tags: -Needs reroll