Change record status: 
Project: 
Introduced in branch: 
11.4.x
Introduced in version: 
11.4.3
Description: 

Two methods have been added to \Drupal\Core\Entity\Query\ConditionAggregateInterface:

  • setQuery(QueryInterface $query): static
  • getQuery(): QueryInterface

These methods were already implemented on all core aggregate condition classes via the ConditionFundamentals trait (used by ConditionAggregateBase), but were not part of the interface contract. They are now declared on the interface so that QueryBase::__clone() and Sql\Query::__clone() can safely re-parent cloned aggregate conditions.

Before

Cloning an aggregate query shared the aggregate condition tree between the original and the clone — calling conditionAggregate() on the clone also modified the original.

After

Cloning an aggregate query produces an independent copy with its own aggregate condition tree.

What you need to do

If you have a custom class that directly implements ConditionAggregateInterface (not by extending ConditionAggregateBase), you must now implement setQuery() and getQuery().
If your class already uses the ConditionFundamentals trait or extends ConditionAggregateBase, no change is needed.

Impacts: 
Module developers