Project

General

Profile

Actions

Bug #82317

open

Queryresult Item-count is wrong with hidden translation items

Added by Frederik Holz almost 7 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2017-09-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Scenario:
  • 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:

Actions

Also available in: Atom PDF