Issue Bug Rejected

#107579PHP 8 Warning: Undefined array key "NEWxxx" in cms-frontend/Classes/Hooks/TreelistCacheUpdateHooks.php line 81

Stephan Großberndt 10/01/25, 13:51 updated 02/05/26, 20:40

Description

How to reproduce:

1. Have a v11 or v12 installation with PHP >= 8.0
2. Remove a column from the pages table, e.g. ALTER TABLE pages DROP COLUMN twitter_description;
3. Try to create a page in the backend

Result:

The creation of the page record fails due to the missing column. But the real reason is not shown, instead there is a cryptic

PHP Warning: Undefined array key "NEWxxx" in cms-frontend/Classes/Hooks/TreelistCacheUpdateHooks.php line 81

Reason:

TreelistCacheUpdateHooks.php line 81 tries to resolve the uid of the newly created page

$affectedPageUid = $dataHandler->substNEWwithIDs[$recordId];

This fails in PHP >= 8.0 as no page has been created due to the SQL error and thus $dataHandler->substNEWwithIDs does not contain an index for the $recordUid='NEWxxx'

The error does not happen in TYPO3 v13 as the class has been removed in #103165

This error has been reported in several other issues (#100828 #103237 #98959) which have all been closed without fixing the core issue.

How to circumvent:

Update the pages table in the database analyzer in the Install Tool in order to recreate the missing column(s).

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.