Bug #93146
closedUpgrade wizard fails while "Loading upgrade wizards" - FormFileExtensionUpdate can't handle pi_flexform containing no data
100%
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"
Updated by Gerrit Code Review almost 4 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67233
Updated by Gerrit Code Review almost 4 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67233
Updated by Gerrit Code Review almost 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67204
Updated by Ayke Halder almost 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 94b89adf240539b40f099075309ace0e29d768ea.
Updated by Ayke Halder about 2 months ago
- Related to Bug #105231: Possible PHP errors and warnings on flexform resolving added