Bug #82317
openQueryresult Item-count is wrong with hidden translation items
0%
Description
- Having a Domain Model of Type A.
- 5 A Models in Default language stored in the backend
- All 5 are translated to a second language, but 4 of the translations are hidden
Acessing a QueryResult via Fluid on a translated page says that the Query Result has 5 Items (even though <f:debug> shows only one)
Iterater also says it's a total of 5 Items (again, even though only 1 is rendered or iteratied through, the one that is not hidden).
If I call a foreach loop in PHP in the controller before returning the query result to the view, everything works as expected and the result shows me only 1 Item, as well as the iterator.
Additional Information:
$querySettings->setRespectStoragePage(FALSE);
$querySettings->setLanguageMode('strict');
are set.
Codes:
Wrong Count:
$downloads = $this->downloadRepository->findByCategories(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $this->settings['categories']));
$this->view->assignMultiple([
'downloads' => $downloads,
]);
Correct count:
$downloads = $this->downloadRepository->findByCategories(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $this->settings['categories']));
foreach ($downloads as $download)
{
$test = '';
}
$this->view->assignMultiple([
'downloads' => $downloads,
]);
<f:debug> with wrong count:
Updated by Georg Ringer about 7 years ago
the overlay which also removes records with no translation is done during runtime. therefore it can't be correct before.
Updated by Frederik Holz about 7 years ago
Georg Ringer wrote:
the overlay which also removes records with no translation is done during runtime. therefore it can't be correct before.
Hey Georg,
sorry for the "stupid" question, but what exactly do you mean? Is this a correct behaviour, like I did something wrong or do I have to intentionally iterate through the records to use the overlay which removes the non-translated records?
Updated by Morton Jonuschat about 7 years ago
- Category changed from Database API (Doctrine DBAL) to Extbase