Bug #20511
closedsmall stability fix proposal for plugin flexform handling
0%
Description
In some case, when a an XML tag is not correctly closed in the flexform_ds.xml of an extension, editing the plugin tt_content element properties in the Typo3 backend displays nothing but the following error :
Fatal error: Cannot use string offset as an array in /var/www/vhosts/agam.org/httpdocs/typo3_src-4.2.6/t3lib/class.t3lib_tceforms.php on line 2371
Changing the following code after line 2371 enables displaying the flexform properly, but with an appropriate error message helping debugging the problem (while the above error does not help) :
This code :
$tabParts[] = array(
'label' => ($dataStruct['ROOT']['TCEforms']['sheetTitle'] ? $this->sL($dataStruct['ROOT']['TCEforms']['sheetTitle']) : $sheet),
'description' => ($dataStruct['ROOT']['TCEforms']['sheetDescription'] ? $this->sL($dataStruct['ROOT']['TCEforms']['sheetDescription']) : ''),
'linkTitle' => ($dataStruct['ROOT']['TCEforms']['sheetShortDescr'] ? $this->sL($dataStruct['ROOT']['TCEforms']['sheetShortDescr']) : ''),
'content' => $sheetContent
);
Should be changed to :
if(is_array($dataStruct['ROOT']))
{
$tabParts[] = array(
'label' => ($dataStruct['ROOT']['TCEforms']['sheetTitle'] ? $this->sL($dataStruct['ROOT']['TCEforms']['sheetTitle']) : $sheet),
'description' => ($dataStruct['ROOT']['TCEforms']['sheetDescription'] ? $this->sL($dataStruct['ROOT']['TCEforms']['sheetDescription']) : ''),
'linkTitle' => ($dataStruct['ROOT']['TCEforms']['sheetShortDescr'] ? $this->sL($dataStruct['ROOT']['TCEforms']['sheetShortDescr']) : ''),
'content' => $sheetContent
);
}else{
$tabParts[] = array(
'label' => $sheet,
'description' => '',
'linkTitle' => '',
'content' => $sheetContent
);
}
Adding the following fixe makes a small stabitity and reliability improvement to plugin flexforms display for extension developers.
(issue imported from #M11198)