Issue Bug Closed

#108587Undefined array key warning in AbstractMenuContentObject language menu processing

Himanshu Ramavat 01/01/26, 11:25 updated 03/31/26, 08:59

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

  1. Simon Schaufelberger commented <span data-processor="relativetime" data-value="2026-01-01T16:41:21+00:00" > 01/01/26, 16:41 </span>

    is this only TYPO3 14? Do you have a website running already on v14?

  2. Himanshu Ramavat commented <span data-processor="relativetime" data-value="2026-01-02T05:32:19+00:00" > 01/02/26, 05:32 </span>

    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 .

  3. Himanshu Ramavat commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-01-04T21:00:09+00:00" > 01/04/26, 21:00 </span>

    Applied in changeset commit:2af335c1002622b986f068bab1b30f12b10ca503.

  4. Gerrit Code Review pushed patch set 1 for 13.4 to change 92450 status Resolved Under Review <span data-processor="relativetime" data-value="2026-01-22T06:35:17+00:00" > 01/22/26, 06:35 </span>

  5. Himanshu Ramavat commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-01-22T07:00:08+00:00" > 01/22/26, 07:00 </span>

    Applied in changeset commit:1928ca115580e4f45ea9f4ed084056f1095272e1.