This path will be to filter the node by language.

Problem:
If the node with entity reference field is not translatable, we have a possible to add any content to this field. And if we setup the render entity display, all nodes wiil be showed to the page, so it is not correct

Solution:
This tiny patch will be to filtered the nodes by language parameters, Only natural language and current language will be displayed.

P.S. Idia of solution is no bad by this link , but it doesn't work at this moment. I think they can be combined, bit later

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

spheresh’s picture

Status: Needs review » Needs work

The last submitted patch, 1998908-entityreference-language-filter-1.patch, failed testing.

spheresh’s picture

spheresh’s picture

Status: Needs work » Needs review
FileSize
1.67 KB
spheresh’s picture

Assigned: Unassigned » spheresh
Status: Needs review » Needs work
spheresh’s picture

Status: Needs work » Needs review
FileSize
1.8 KB
Chris Matthews’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Assigned: spheresh » Unassigned
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 5 year old patch in #6 to entityreference.module does not apply to the latest 7.x-1.x-dev and if still relevant needs a reroll.

Checking patch entityreference.module...
error: while searching for:
 * Implements hook_field_formatter_prepare_view().
 */
function entityreference_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) {
  $target_ids = array();

  // Collect every possible entity attached to any of the entities.
  foreach ($entities as $id => $entity) {
    foreach ($items[$id] as $delta => $item) {
      if (isset($item['target_id'])) {
        $target_ids[] = $item['target_id'];
      }
    }
  }

error: patch failed: entityreference.module:1169
error: entityreference.module: patch does not apply