Bug #93146

Upgrade wizard fails while "Loading upgrade wizards" - FormFileExtensionUpdate can't handle pi_flexform containing no data

Added by Ayke Halder 12 months ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2020-12-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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"    
#1

Updated by Gerrit Code Review 12 months 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

#2

Updated by Gerrit Code Review 12 months 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

#3

Updated by Gerrit Code Review 12 months 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

#4

Updated by Ayke Halder 12 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#5

Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF