#110200LanguageMenuProcessor calls unnecessary hasSubpages
Description
The inner workings of the LanguageMenuProcessor have been updated in v14 in this commit (for the better):
https://review.typo3.org/c/Packages/TYPO3.CMS/+/92385
Unfortunately this has one side effect, for only calculating/rendering the hreflangs the hasSubpages is always called:
https://git.typo3.org/typo3/typo3/-/blob/v14.3.5/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php?ref_type=tags#L1912
Which calls the expensive isSubmenu function:
https://git.typo3.org/typo3/typo3/-/blob/v14.3.5/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php?ref_type=tags#L1379-1452
If your current page has a lot of subpages (in our case 30.000+) this completely runs out of memory.
My opinion would be that the LanguageMenuProcessor does not need to know that a page has subpages, and this expensive call is not necessary, but the getMenuItems is also used for the MenuProcessor so it’s shared functionality.
Reviews 3
History 47
-
Riny van Tiggelen changed description <span data-processor="relativetime" data-value="2026-07-15T13:51:10+00:00" > 07/15/26, 13:51 </span>
-
Benni Mack changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2026-08-06T16:03:00+00:00" > 08/06/26, 16:03 </span>
-
Oliver Bartsch commented <span data-processor="relativetime" data-value="2026-10-19T20:55:09+00:00" > 10/19/26, 20:55 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96890 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-19T20:55:22+00:00" > 10/19/26, 20:55 </span> -
Gerrit Code Review pushed patch set 2 for main to change 96890 <span data-processor="relativetime" data-value="2026-10-24T20:25:40+00:00" > 10/24/26, 20:25 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97205 <span data-processor="relativetime" data-value="2026-10-28T18:26:26+00:00" > 10/28/26, 18:26 </span>
-
Oliver Bartsch commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-28T18:35:14+00:00" > 10/28/26, 18:35 </span>Applied in changeset commit:19ae37515ac6c153961445f0780633eebc033ae5.
Hey,
thanks for the report and the analysis, I can confirm this.
Since 14.1, the LanguageMenuProcessor builds its items through AbstractMenuContentObject::getMenuItems(), which calculates
hasSubpagesfor every item by calling isSubMenu(). For a language menu, every item is the current page, so this check loads all subpages of the current page with all columns. On pages with a very large number of subpages that runs out of memory. Up to v13 this never happened for language menus: their items carry an explicit ITEM_STATE, so the IFSUB evaluation was always skipped.I will push a patch that skips the subpage check for language menus in getMenuItems().
hasSubpagesis still part of the language menu items, but it is always 0 again, just like in v13. This also applies to a MenuProcessor configured withspecial = language. Regular menus are not affected.Cheers, Oli