Bug #88344

HMENU directory incompatible with free mode

Added by Andreas Kiessling over 1 year ago. Updated 10 months ago.

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

100%

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) {

Related issues

Related to TYPO3 Core - Bug #89368: Active page Closed 2019-10-08
Related to TYPO3 Core - Bug #89038: HMENUs special "directory" does not work properly with sites fallbackType "free" Closed 2019-08-29
Related to TYPO3 Core - Bug #89989: Since v9.5.12 extendToSubpages has no effect for subpages in menus Closed 2019-12-18
Related to TYPO3 Core - Bug #88685: With "Hide default translation of page" no link for alternate language is generated Closed 2019-07-04
Related to TYPO3 Core - Bug #85987: Menus doesn't respect language settings and show non translated pages Accepted 2018-08-27
Related to TYPO3 Core - Bug #88987: Menu Generation Fails on Translated Websites Closed 2019-08-20
Related to TYPO3 Core - Bug #90971: HMENU regression in 9.5.12 Closed 2020-04-07

Associated revisions

Revision 47e63fc3 (diff)
Added by Michael Binder 11 months ago

[BUGFIX] Use existing API instead of ContentObjectRenderer

This Patch allows the usage of an HMENU with special = directory and
the Fallback Type 'Free mode'

Resolves: #88344
Related: #89368
Releases: master, 9.5
Change-Id: Ib7f53b4e061b6387e6b29b2545696a3eb2d015a0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62527
Tested-by: TYPO3com <>
Tested-by: Tobias Gaertner <>
Tested-by: Benni Mack <>
Reviewed-by: Guido Schmechel <>
Reviewed-by: Tobias Gaertner <>
Reviewed-by: Benni Mack <>

Revision b45552ad (diff)
Added by Michael Binder 11 months ago

[BUGFIX] Use existing API instead of ContentObjectRenderer

This Patch allows the usage of an HMENU with special = directory and
the Fallback Type 'Free mode'

Resolves: #88344
Related: #89368
Releases: master, 9.5
Change-Id: Ib7f53b4e061b6387e6b29b2545696a3eb2d015a0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62466
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Christian Eßl about 1 year ago

#2 Updated by Gerrit Code Review 11 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62527

#3 Updated by Michael Binder 11 months ago

I had the same problem and your solution works well, thank you for that.
I also tested it with the other fallback types and the menu is always displayed correctly. So I made a patch and sent it to Gerrit.

#4 Updated by Tobias Gaertner 11 months ago

  • Related to Bug #89038: HMENUs special "directory" does not work properly with sites fallbackType "free" added

#5 Updated by Gerrit Code Review 11 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62466

#6 Updated by Michael Binder 11 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Andreas Kiessling 11 months ago

Thanks Michael for taking care! :D

#8 Updated by Georg Ringer 11 months ago

  • Related to Bug #89989: Since v9.5.12 extendToSubpages has no effect for subpages in menus added

#9 Updated by Benni Mack 10 months ago

  • Status changed from Resolved to Closed

#10 Updated by Benni Mack 10 months ago

  • Related to Bug #88685: With "Hide default translation of page" no link for alternate language is generated added

#11 Updated by Benni Mack 10 months ago

  • Related to Bug #85987: Menus doesn't respect language settings and show non translated pages added

#12 Updated by Georg Ringer 8 months ago

  • Related to Bug #88987: Menu Generation Fails on Translated Websites added

#13 Updated by Georg Ringer 7 months ago

  • Related to Bug #90971: HMENU regression in 9.5.12 added

Also available in: Atom PDF