Bug #73574
closedCSH for FlexForms broken since Version 7.6
100%
Description
CSH files assigned for flexforms by \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr()
stopped working with the new BE form rendering in Version 7.6.
Please have a look at line 56 ff. of TYPO3\CMS\Backend\Form\Container\FlexFormNoTabsContainer
and line 60 ff. of TYPO3\CMS\Backend\Form\Container\FlexFormTabsContainer
.
56 // Assemble key for loading the correct CSH file 57 // @todo: what is that good for? That is for the title of single elements ... see FlexFormElementContainer! 58 $dsPointerFields = GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['ds_pointerField'], true); 59 $parameterArray['_cshKey'] = $table . '.' . $fieldName; 60 foreach ($dsPointerFields as $key) { 61 if ((string)$row[$key] !== '') { 62 $parameterArray['_cshKey'] .= '.' . $row[$key]; 63 } 64 }
@todo: what is that good for? > it "assembles a key for loading the correct CSH file".
The "key" ($parameterArray['_cshKey']
) is defined as [table name].[field name].[DS pointer field 1](.[DS pointer field 2])
(see https://buzz.typo3.org/teams/core/article/getting-ready-for-45-changes-in-csh-for-flexforms/).
The right/working key for an EXT:news plugin is tt_content.pi_flexform.news_pi1.list
The values of $row['CType']
and $row['list_type']
(and some other fields like colPos, header_layout, recursive, l18n_parent) are stored as arrays with key 0
.
An Example $row
for an EXT:news plugin:
CType => array(1 item) 0 => 'list' (4 chars) list_type => array(1 item) 0 => 'news_pi1' (8 chars)
As a consequence $parameterArray['_cshKey']
is set as tt_content.pi_flexform.Array
or tt_content.pi_flexform.Array.Array
and thus no csh is rendered for formlabels in flexforms.
I've no idea why some field values are stored as array and other are not (e.g. tt_content.header
and tt_content.CType
are both of type varchar(255) DEFAULT '' NOT NULL
). If that's OK, both classes mentioned above shouldn't simply cast $row[$key]
as a string but must use is_string($row[$key]) && $row[$key] !== ''
and is_array($row[$key]) && isset($row[$key][0]) && is_string($row[$key])
.
System environment: PHP 5.5.9-1ubuntu4.14 / mysql 5.5.46 / TYPO3 CMS 7.6 (composer)