Closed VincentLanglet closed 4 years ago
The concerns about this behavior seem to be addressed at #501.
Indeed it seems kinda-related.
But if adding a resetDQLPart('groupBy')
can help for the listing, i think it will give bad results for filtering.
@greg0ire You may still have advice to provide.
Sorry but this is way too old :sweat_smile:
I tested in my project
return array_sum(array_column(
($countQuery->resetDQLPart('orderBy')->getQuery()->getResult(Query::HYDRATE_SCALAR)),
'cnt'
));
It's not the best but it fix the issue.
The PR doesn't entirely solve the issue if the select
contains aggregate columns (eg: SELECT SUBSTR(created_at, 1, 7) as month FROM foo GROUP BY month
would fail because month
is removed from the select
Environment
Sonata packages
Subject
When writing a custom filter like this
Or like this
Or again like this
With a
LEFT_JOIN
and aGROUP BY
, we get an errorIt's coming from the
computeNbResult
.I tried to
return 0
inside and my query works. The error is just coming from computeNbResult.