Views entity reference displays don't take aggregation into account when adding the ID field

Created on 13 August 2025, 3 days ago

Problem/Motivation

When you use a Views entity reference display in a field and the View uses aggregation, that aggregation is lost when looking at the field values. The aggregation works fine in the Views preview

Steps to reproduce

  • Build a Views entity reference display showing all content
  • Add only the 'Title' field
  • Enable aggregation
  • Group the View on Title
  • Add a Content reference field to one of you content type that uses the new Views display to show values
  • Create 2 nodes with the same title
  • Check the Views preview for the new display -> only 1 of the nodes is shown
  • Check the available values for the new field -> both nodes are shown

Proposed resolution

Make EntityReference::query() grouping aware and make it deal with it

Remaining tasks

Fix
Tests
Reviews

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

views.module

Created by

🇳🇱Netherlands Lendude Amsterdam

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024