Bug #85055
closedIllegal string offset error when editing content with specific pi_flexform value (PHP 7)
0%
Description
With PHP 7, editing a tt_content with pi_flexform having the following value will throw an uncaught Typo3 error if the flexform has to be extended during processing :
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3FlexForms> <data> <sheet index="sDEF"> <language index="lDEF"></language> </sheet> </data> </T3FlexForms>
This value causes an error to be thrown at line 559 of sysext/backend/Classes/Form/FormDataProvider/TcaFlexProcess.php as $result['databaseRow'][$fieldName]['data'][$dataStructureSheetName]['lDEF'] is then set to an empty string, which isn't automatically converted to an empty array with PHP 7. Casting it to an array solves the issue.
I have not been able to test it, but I am fairly sure this problem will also happen in Typo3 7.6 with PHP 7. With PHP 5.5 (and Typo3 7.6.21), editing these contents works without any problem.
Steps to reproduce :
1. Have a tt_content with the problematic value in pi_flexform. This is probably the hardest part, as I haven't been able to generate it apart from leftover
pi_flexform in several content elements after migrating from TemplaVoilà to Grid Elements during our migration to Typo3 7.6.
2. Edit said tt_content. If the tt_content does not already extend the stored flexform value and generate the error, changing the type to a tt_content that has flexform will cause the issue.