#93146Upgrade wizard fails while "Loading upgrade wizards" - FormFileExtensionUpdate can't handle pi_flexform containing no data
Description
Run Upgrade Wizards fails while “Loading upgrade wizards”
System
TYPO3: 10.4.11 (composer-based)
Steps to reproduce
Have a content element with a pi_flexform containing no data:
INSERT INTO `tt_content` (`CType`, `pi_flexform`) VALUES('form_formframework', '<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n<T3FlexForms>\n</T3FlexForms>');
Then open install tool and in module “Upgrade” click on “Run upgrade wizard”.
Stack trace
(1/1) TypeError
Argument 1 passed to TYPO3\CMS\Form\Hooks\FormFileExtensionUpdate::getPersistenceIdentifierFromFlexform() must be of the type array, string given, called in /var/www/html/public/regional/typo3/sysext/form/Classes/Hooks/FormFileExtensionUpdate.php on line 471
in /var/www/html/public/regional/typo3/sysext/form/Classes/Hooks/FormFileExtensionUpdate.php line 621
/**
* param array $flexform
* return string
*/
protected function getPersistenceIdentifierFromFlexform(array $flexform): string
{
return $flexform[‘data’][‘sDEF’][‘lDEF’][‘settings.persistenceIdentifier’][‘vDEF’] ?? ‘’;
}
at TYPO3\CMS\Form\Hooks\FormFileExtensionUpdate->getPersistenceIdentifierFromFlexform(‘’)
in /var/www/html/public/regional/typo3/sysext/form/Classes/Hooks/FormFileExtensionUpdate.php line 471
if (empty($pluginData[‘pi_flexform’])) {
continue;
}
$flexform = GeneralUtility::xml2array($pluginData[‘pi_flexform’]);
$referencedPersistenceIdentifier = $this->getPersistenceIdentifierFromFlexform($flexform);
$referenceHasNewFileExtension = $this->hasNewFileExtension($referencedPersistenceIdentifier);
$possibleOldReferencedPersistenceIdentifier = $this->getOldPersistenceIdentifier($referencedPersistenceIdentifier);
$possibleNewReferencedPersistenceIdentifier = $this->getNewPersistenceIdentifier($referencedPersistenceIdentifier);
—-
$formDefinitionsInformation = {array} [0]
$pluginData = {array} [2]
uid = {int} 19
pi_flexform = "<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\n<T3FlexForms>\n</T3FlexForms>"
$flexform = "\n"
Hint: These are real newlines – only escaped here for visibility.
—-
protected static function xml2arrayProcess($string, $NSprefix = '', $reportDocTag = false)
|--> xml_parse_into_struct($parser, $string, $vals, $index);
$NSprefix = ""
$index = {array} [1]
T3FlexForms = {array} [1]
0 = {int} 0
$match = {array} [2]
0 = "<?xml version="1.0" encoding="utf-8""
1 = "utf-8"
$parser = {resource} resource id='610' type='xml'
$previousValueOfEntityLoader = false
$reportDocTag = false
$string = "<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\n<T3FlexForms>\n</T3FlexForms>"
$theCharset = "utf-8"
$vals = {array} [1]
0 = {array} [4]
tag = "T3FlexForms"
type = "complete"
level = {int} 1
value = "\n"