- 🇦🇺Australia mstrelan
Tested on 10.1.x and can confirm this is still an issue. Updated steps to reproduce.
- 🇺🇸United States smustgrave
Can confirm the issue on 10.2
Actually the roles field doesn't even appear as an option.
- 🇧🇷Brazil carolpettirossi Campinas - SP
My use case: I wanted to create a view reporting the number of users for each role. However, when I enable aggregation I cannot see the Roles field available to be added.
- 🇺🇸United States scotwith1t Birmingham, AL
I am running into a somewhat similar situation. I have a view which has relationships which create duplicate rows, so I've enabled aggregation. When I tried to remove the relationships, the view cache gets all wonky and starts throwing this:
InvalidArgumentException: A valid cache entry key is required. Use getAll() to get all table data. in Drupal\views\ViewsData->get() (line 137 of core/modules/views/src/ViewsData.php).
The only way to restore it that I can figure out is to completely delete the view and then re-import configs to restore it.
- 🇺🇸United States mortona2k Seattle
Here's where the argument options are loaded in the settings form: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/views...
$relationship_options is empty when the view is aggregated.
The Author argument and Roles field are defined here: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/user/...
Setting $data['user__roles']['roles_target_id']['field']['no group by'] = FALSE allows selecting the relationship with aggregation enabled.
I'm not really sure what the implications of this are though.