- Issue created by @Neelanjana Das
In Views, changing the aggregation type of a field (e.g., from Count to Sum or Average) does not take effect after saving. The View continues to apply the old aggregation type, even after clearing caches. The UI appears to save the change, but the output doesn't reflect it.
1. Create a View and enable `Use aggregation` under the "Advanced" section.
2. Add a numeric field (e.g., node ID or a custom integer field).
3. Set its aggregation type to "Count" and save the View.
4. Now go back and try to change the aggregation type to "Sum", "Average", or any other.
5. Save the View and clear all caches.
6. Reload the View output.
The only way to make the new aggregation type work is to:
- Delete the field from the View entirely.
- Set `Use aggregation` to **No** and save the View.
- Re-enable `Use aggregation`, then re-add the field and set the desired aggregation type.
This resets the internal state and makes the new aggregation type apply correctly.
- Drupal 9.5.x
- Drupal 10.5.x
When an aggregation type is changed and the View is saved, the new aggregation should immediately reflect in the output, without needing to delete and reconfigure the field.
This appears to be a bug in the Views UI. The field’s aggregation type doesn’t update properly unless the field is deleted and re-added, which is not ideal for user experience.
Active
10.5 ✨
views.module
Involves, uses, or integrates with views. In Drupal 8 core, use the “VDC” tag instead.