Referenced entity with multiple values making duplicate rows in views I checked 'distinct' in my view configuration in Query settings under the 'advanced' fieldset.

So say when I have have three entities connected to one node, there would be three rows in my view of the same node of course one for each entity. 

Fields settings    


Content: Hour ('event')
Content: Title ('event')
Content: Body ('event')
(Content entity referenced from field_event_performer) Content: Title   
(Content entity referenced from field_event_performer) Content: Body  
(Content entity referenced from field_event_performer) Content: Foto  
Content: Title  ('event')
(Content entity referenced from field_event_performer) Content: Performer    


Some fields I've given a class in order to hide them using jQuery and show them in a modal frame when clicked on. That's why fields are shown double. First I thought the problem was be because of the weird field settings. But the nodes that show only one time have the same field settings, only do they have more performers referenced.  

I have 4 filter criteria in total: 


Content: Published (Yes)
Content: Type (= Event)    
Content: Evenement type (= Presentatie) | Settings  (taxonomy)  
Content: Locatie (= Kraakhuis)   | (taxonomy)


Having done searches I noticed that everyone who had this problem, only needed 1 field from the referenced entity and could use the aggregation funtion as found under advanced. This works quite fine here as well if I only needed 1 field.   

But in my case, when output into a modal frame, one entire row should look like this:


Node123 title
Node123 body
referenced entity 1 title
referenced entity 1 body
referenced entity 1 picture
referenced entity 2 title
referenced entity 2 body
referenced entity 2 picture
referenced entity 3 title
referenced entity 3 body
referenced entity 3 picture
What helped is going custom code. Instead of relying on the fields that would have come out of the Views query, I grabbed the nid of my referenced field of my 'event' content type and loaded the rest of the fields via node_load();. All of this happening in a tpl file views-view-fields--viewnale--block.tpl.php

I used the row object and made a loop that went over the multiple valued referenced entity. 

    &lt;?php foreach($row-&gt;field_field_evenement_performer_1 as $key =&gt; $whatever): ?&gt;
    &lt;?php $performer = node_load($row-&gt;field_field_evenement_performer_1[$key]['raw']['target_id']);


    $title = $performer-&gt;title;
    $picture = $performer-&gt;field_performer_foto['und'][0]['uri'];   
    $bio = $performer-&gt;body['und'][0]['value'];  

    print '&lt;div class=\'forModal\'&gt;&lt;h3&gt;' . $title . '&lt;/h3&gt;&lt;/div&gt;';
    print '&lt;div class=\'forModal\'&gt;&lt;img src="' . $picture . '"/&gt;&lt;/div&gt;';
    print '&lt;div class=\'forModal\'&gt;' . $bio . '&lt;/div&gt;'; ?&gt;

&lt;?php endforeach ?&gt;