Project

General

Profile

Actions

Bug #82317

open

Queryresult Item-count is wrong with hidden translation items

Added by Frederik Holz about 7 years ago. Updated about 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 #1

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.

Actions #2

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?

Actions #3

Updated by Morton Jonuschat about 7 years ago

  • Category changed from Database API (Doctrine DBAL) to Extbase
Actions

Also available in: Atom PDF