Bug #88344

HMENU directory incompatible with free mode

Added by Andreas Kiessling 14 days ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2019-05-13
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When TYPO3 is set to run in Free mode, HMENU of type directory stop working for localized pages.
The query to fetch the subpages uses exec_getQuery from the ContentObjectRenderer, thus \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getLanguageRestriction is applied and the pages with the required languages are fetched directly.

In theory, this behaviour is correct, since it returns what it was configured for for, but pages is a special case, where at some points the overlay information from _PAGES_OVERLAY and _PAGES_OVERLAY_LANGUAGE is checked, as well as the page id differs to what the router returns.
See \TYPO3\CMS\Frontend\Page\PageRepository::isPageSuitableForLanguage for the mentioned checks.

It seems like replacing the exec_getQuery with the already existing API does the job, see \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject::prepareMenuItemsForDirectoryMenu

            // Get sub-pages:
//            $statement = $this->parent_cObj->exec_getQuery('pages', ['pidInList' => $id, 'orderBy' => $sortingField]);
//            while ($row = $statement->fetch()) {

            $rows = $this->sys_page->getMenu($id, '*', $sortingField);
            foreach ($rows as $row) {

Also available in: Atom PDF