Views issue with reference fields

Public

</> CopyGet raw version
text
  1. diff --git a/modules/field/views_handler_field_field.inc b/modules/field/views_handler_field_field.inc
  2. index 703d491..85a624c 100644
  3. --- a/modules/field/views_handler_field_field.inc
  4. +++ b/modules/field/views_handler_field_field.inc
  5. @@ -702,7 +702,7 @@ EOT
  6. $entity_type = $value->_field_data[$this->field_alias]['entity_type'];
  7. $entity_info = entity_get_info($entity_type);
  8. $id = $entity->{$entity_info['entity keys']['id']};
  9. - $views_row_entities[$id] = $row_id;
  10. + $views_row_entities[$id][] = $row_id;
  11. $views_entities[$entity_type][$id] = $entity;
  12. }
  13. }
  14. @@ -727,16 +727,18 @@ EOT
  15. }
  16.  
  17. foreach ($entities as $entity_id => $entity) {
  18. - $display = array(
  19. - 'type' => $this->options['type'],
  20. - 'settings' => $this->options['settings'],
  21. - 'label' => 'hidden',
  22. - // Pass the View object in the display so that fields can act on it.
  23. - 'views_view' => $this->view,
  24. - 'views_field' => $this,
  25. - 'views_row_id' => $views_row_entities[$entity_id],
  26. - );
  27. - $values[$views_row_entities[$entity_id]]->{'field_' . $this->options['id']} = $this->set_items($entity_type, $entity, $display);
  28. + foreach ($views_row_entities[$entity_id] as $views_row_id) {
  29. + $display = array(
  30. + 'type' => $this->options['type'],
  31. + 'settings' => $this->options['settings'],
  32. + 'label' => 'hidden',
  33. + // Pass the View object in the display so that fields can act on it.
  34. + 'views_view' => $this->view,
  35. + 'views_field' => $this,
  36. + 'views_row_id' => $views_row_id,
  37. + );
  38. + $values[$views_row_id]->{'field_' . $this->options['id']} = $this->set_items($entity_type, $entity, $display);
  39. + }
  40. }
  41. }
  42. }