Issue Bug Closed

#97619Undefined array key "_CURRENT_VERSION" in CleanFlexFormsCommand

Alexander Grein 05/12/22, 18:30 updated 10/04/22, 14:03

Description

After updating from TYPO3 10.4 to 11.5 my deployment script throw this exception when calling “vendor/bin/typo3 cleanup:flexform”:

Warning: Undefined array key "_CURRENT_VERSION" in /..../private/typo3/sysext/lowlevel/Classes/Command/CleanFlexFormsCommand.php line 173

After debugging the mentions line 173, I found the cause in a condition, which is not PHP 8 compatible, because the array key doesn’t exists in some cases:

if (!$verRec['_CURRENT_VERSION']) {

To fix this issue it can just be changed to the following, since the value of this key can only be “true” or not set (see previous BackendUtility::selectVersionsOfRecord method):

if (!isset($verRec['_CURRENT_VERSION'])) {

Reviews 2