π¬ | Drupal core | Cannot select multi fields when using group by in the default configuration of MySQL
πΊπΈUnited States Clarentina
I experienced the same issue on D9.5 even with the addition of #6. This worked fine on D9.4.
After a bit of debugging, I was able to solve this issue by adding each groupBy field separately to the query.
For example,
$query->groupBy('ttdf.tid, ttdf.name');
now became,
$query->groupBy('ttdf.tid');
$query->groupBy('ttdf.name');