Issue Bug Closed

#82317Queryresult Item-count is wrong with hidden translation items

Anonymous 09/06/17, 15:00 updated 04/03/25, 11:43

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)<br>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).</f:debug>

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:<br><img alt src="https://i.imgur.com/gjQs5kz.png"></f:debug>

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Georg Ringer commented <span data-processor="relativetime" data-value="2017-09-07T08:05:47+00:00" > 09/07/17, 08:05 </span>

    the overlay which also removes records with no translation is done during runtime. therefore it can’t be correct before.

  2. Anonymous commented <span data-processor="relativetime" data-value="2017-09-11T15:55:19+00:00" > 09/11/17, 15:55 </span>

    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?