Bug #60463
closedWrong condition against Statement in getObjectCountByQuery
0%
Description
Hello Core-Team,
I have created my own statement that way:
return $query->statement($sql, array(..., ...))->execute();
Further I have added a check on count of this result and YES: I know that this could not work :-)
<f:if condition="{projects -> f:count()}"> ... </f:if>
In Typo3DbBackend.php I found these rows in getObjectCountByQuery
if ($query->getConstraint() instanceof Statement) { throw new \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException('Could not execute count on queries with a constraint of type TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Statement', 1256661045); }
But Contraint is NULL of cause. I have created a statement instead as mentioned above. Some lines up in method getObjectDataByQuery you have done it correct:
$statement = $query->getStatement(); if ($statement instanceof Statement) {
In my opinion we/you should copy the correct part of getObjectDataByQuery also to getObjectCountByQuery.
Stefan
Updated by Gerrit Code Review almost 10 years ago
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31721
Updated by Gerrit Code Review almost 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31721
Updated by Gerrit Code Review about 9 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31721
Updated by Mathias Schreiber about 9 years ago
- Target version deleted (
next-patchlevel)
Updated by Anja Leichsenring over 6 years ago
- Status changed from Under Review to Rejected