0

I have a view that uses the OG Relationship "OG membership: Group Content (node) from OG membership", and this relationship is causing duplicates when a person has more than one group assigned to them.

If I use aggregation settings along with checking the distinct checkbox in the query settings, the duplicates disappear. (Oddly enough, I needed to use BOTH aggregation and "Distinct".)

However, I want the ALL Content Titles for the related Group (which is why I needed the relationship).

I even tried the Views Distinct module, but after fumbling around with it, it either shows one Content Title from the group or all Content Titles from all groups.

All of this behavior leads me to believe there's an issue with OG relationships because there's no way to aggregate the content titles that I can find.

Am I looking at a views hook to fix the issue?

0

Okay, so I believe I traced the issue to a problem with Entity Reference Relationships in Views, and posted a bug.

However, I was able to solve the duplicate issue AND get the results I wanted (all titles from related groups) by taking a different approach in the View.

Instead of hook_query_alter() or hook_views_pre_render(), I just wound up adding the field that reference the groups, setting the Formatter to "Label", and checking the "Link label to referenced entity." This produced a comma-separated list of groups linked to the group page (exactly what I wanted).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.