[TYPO3-mvc] QueryResult object has issues with offsets and "count" method ?

Franz Koch typo3.RemoveForMessage at elements-net.de
Fri Nov 19 12:08:10 CET 2010


Hey again,

>> Can you please debug $statement at the end of
>> Tx_Extbase_Persistence_Storage_Typo3DbBackend::getObjectCountByQuery()?
>
> hehe, I already did in the meantime. The query itself looks ok, except
> for the fact that the LIMIT statement is not filtered out, and this
> somehow leads to a FALSE return value in the Typo3DBBackend instead of
> returning the count of the limited subset. The query looks like:
>
> SELECT DISTINCT COUNT(*) FROM xyz LEFT JOIN ... WHERE ... ORDER BY
> xyz.title ASC LIMIT 100, 50

a easy fix would be to simply unset the LIMIT clause from the statement 
in the getObjectCountByQuery method of the Typo3DBBackend like this:

... line 260 ....
$statementParts['fields'] = array('COUNT(*)');
# NEW
unset($statementParts['limit']);

Doing this it's working for me, but question is, how to get the actual 
count of the desired subset then?
-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list