#108587Undefined array key warning in AbstractMenuContentObject language menu processing
Description
When using HMENU with special = language and manually specifying language IDs in special.value (e.g., `special.value = 1,2,3`) , if any of the specified language IDs don’t exist in the site’s language configuration, a PHP warning is thrown:
PHP Warning: Undefined array key 1 in
/var/www/html/vendor/typo3/cms-frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php line 580
This occurs in the prepareMenuItemsForLanguageMenu() method when the code tries to access $languages[$sUid] without first checking if the key exists in the array. The issue happens when special.value is not set to ‘auto’ and contains language IDs that aren’t configured in the site.
Reviews 2
History 59
-
Gerrit Code Review pushed patch set 1 for main to change 92239 status
NewUnder Review 01/01/26, 11:32 -
Gerrit Code Review pushed patch set 2 for main to change 92239 01/01/26, 13:15
-
Simon Schaufelberger commented 01/01/26, 16:41
-
Himanshu Ramavat commented 01/02/26, 05:32
Simon Schaufelberger wrote in #note-3:
> is this only TYPO3 14? Do you have a website running already on v14?I currently have a website running on TYPO3 v11 and encountered this issue while preparing the upgrade to v13.
The problem occurs when special.value contains language IDs that are not present in the site language configuration, which leads to accessing a non-existing $languages[$sUid] .
The relevant code in v13 and v14 is identical , which is why I selected TYPO3 version 14 in the ticket. However, the issue is also present in TYPO3 v13 .
-
Gerrit Code Review pushed patch set 3 for main to change 92239 01/02/26, 19:45
-
Himanshu Ramavat commented and changed status
Under ReviewResolved done0 %100 % 01/04/26, 21:00Applied in changeset commit:2af335c1002622b986f068bab1b30f12b10ca503.
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 92450 status
ResolvedUnder Review 01/22/26, 06:35 -
Himanshu Ramavat commented and changed status
Under ReviewResolved 01/22/26, 07:00Applied in changeset commit:1928ca115580e4f45ea9f4ed084056f1095272e1.
-
Benni Mack changed status
ResolvedClosed 03/31/26, 08:59
is this only TYPO3 14? Do you have a website running already on v14?