#87655Wrong count by extbase with own QueryBuilder
Description
Hello Core-Team,
I have created my own Query with QueryBuilder. As I need a relation to categories I have to prevent duplicates through LEFT JOIN. So I have added GROUP BY to my QueryBuilder and give it to $query->statement($myQueryBuilder).
If I call f:count() in fluid on result it should return 13, but it returns 1. That’s because of a problem with COUNT and GROUP BY which results in:
COUNT
1
4
2
3
3
This problem is known in extbase. It is solved with help of $suggestDistinctQuery in Typo3DbQueryParser. But in case of an own QueryBuilder object, this property keeps untouched.
I prefer to check own QueryBuilder objects for an existing GROUP BY and set suggestDistinctQuery to true.
Stefan
Reviews 2
- 10.4 66392[BUGFIX] Fix count for custom queries with group by statement
- main 59641[BUGFIX] Fix count for custom queries with group by statement
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[BUGFIX] Wrong count by extbase with own QueryBuilder Resolves: #87655 Releases: main