Bug #62518

Wrong result count

Added by Natalia Postnikova almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-10-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Code:

$result = $this->pageRepository->findByTagAndCategory($tag, $category);
if($result->count() > 0) {
    // always returns the number of pages total
}

If I echo the result count in my controller or in the view before processing the rows in a for-loop, the result count always returns the number of all entries in the db. The wrong result count can be "fixed" with a empty loop:
$result = $this->pageRepository->findByTagAndCategory($tag, $category);
foreach($result as $row) {
    // empty for loop to adjust counting
}
if($result->count() > 0) {
    // always return the number of total results
}

Also available in: Atom PDF