Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Create a view that has an imagefield. Turn on aggregation. Notice that the image is no longer displayed. Go to "Aggregation settings", change the Group column from "fid" to "Entity ID" and voila, it works.
So let's have a default that is more likely to work for people
bojanz: seems like Aggregation kills imagefields
[5:01pm] bojanz: actually, works if you tell it to group by the entity id and not the fid (in the group settings for the image field itself)
[5:03pm] merlinofchaos: Yeah, that's going to be true for any field more complex than a text/numeric, probably.
[5:04pm] bojanz: I wonder how we can make that more obvious to users though... or make it work on first try
[5:04pm] merlinofchaos: bojanz: That's an excellent question.
[5:04pm] merlinofchaos: Perhaps we could provide some hints in the definition.
[5:06pm] bojanz: merlinofchaos: perhaps default to grouping on entity id when the field is complex?
[5:08pm] merlinofchaos: bojanz: Yeah. We could probably do that.
Comments
Comment #1
dawehnerIt seems to be that for all the actual "data" fields like numbers/textfield you want to groupby this field,
for other more complex fields like imagefield/filefield/(perhaps text-format) you want entity id.
What about making the ("value" )-column the default if there is just one column, but make it also configurable(not sure whether it's at the moment) on the definition level?
Comment #2
dawehnerWhile the value column is the single column
Comment #3
bojanz CreditAttribution: bojanz commentedBut if it's a setting on the definition level, who will change it, override it whatever? I think just going with "value" if it's there, "entity id" if it isn't should be enough.
Comment #4
MustangGB CreditAttribution: MustangGB commented