Zum Inhalt springen

TYPO3 PHP Warning: „Core: Error handler (BE): PHP Warning: Undefined array key „uid“ in … „

This warning (or error) is caused by outdated TYPO3 conditions in TypoScripts. In my case of TYPO3 11.5.30 it only was shown in the backend with big yellow bars, when the general debug setting (Admin Tools -> Settings -> Configuration Presets -> Debug Settings) was on „Live“. In „Debug“ mode it was gone.

Solution:

change from:

[page["uid"] == 1]

to:

[traverse(page, "uid") == 1]

or any similar condition that is no more working according to the new rules.

The TYPO3 documentation says:

page is only available in the frontend context. As the TypoScript setup may be loaded in some backend modules or the CLI context, it is considered best practice to always guard the property by using the function traverse().“

source:

https://docs.typo3.org/m/typo3/reference-typoscript/11.5/en-us/Conditions/Index.html#page

It only appears with PHP version 8, if you go back to PHP 7.4 the error message is gone!

Author:
Thomas Hezel
email: info@zazu.berlin

    Schreibe einen Kommentar

    Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert