Actions
Bug #87655
openWrong count by extbase with own QueryBuilder
Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2019-02-05
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
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
Actions