Aggregation breaks view relationship UI.

Created on 10 July 2021, almost 4 years ago
Updated 12 May 2023, about 2 years ago

Problem/Motivation

Always had issues with Views aggregation; but this is a new one.

This is a "Group content" view; doubt that it matters.

I have a view which is a list of users in groups. It therefore requires a relationship to "Group content user". I list the Group names (table grouped on this); and within each group i list the user's name and the roles they are in. Easy enough, this works as expected. I was trying to figure out a way to have the 1 user in that group that has an extra role stick at the top of each group (i.e. the group's coordinator). I have added aggregation and then a sort on count(roles). This also works as expected. Great.

But, later i needed to add a class to the roles field. When i edit the field i see that the Relationship selector is now missing. Only on this field though. All other fields still have the relationship selector. If i save the role field it now shows as empty in my results (which makes sense as i have now saved it without the required relationship).

The only way to fix this is to disable aggregation and then go back and re-save the role field (which now has the relationship selector).

Steps to reproduce

Using just core:

  1. Install Drupal with standard profile
  2. Edit the default Content view at /admin/structure/views/view/content
  3. Add the Roles field using the Author relationship
  4. Enable aggregation under Advanced > Other > Use aggregation
  5. Click on the Roles field and see that the relationship selector is missing

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.1

Component
Views UI 

Last updated 5 days ago

Created by

🇨🇦Canada liquidcms

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024