Bug #70904
closedIRRE: foreign_record_defaults for colPos gets trimmed
100%
Description
TYPO3 7.5
Use-case:
Referencing tt_content in IRRE elements, the child elements pop up in the standard content area due to them having the same colPos as the parent element. If only you could assign the IRRE children some other colPos to hide them (like, 1 if gridelements is installed ;))!
Issue:
If you configure an inline element in the TCA and try to set the colPos using the foreign_record_defaults array, the colPos-value gets trimmed to the first character.
Example:
TCA:
'myColumn' => array(
'exclude' => 1,
'label' => 'IRRE relation to tt_content',
'config' => array(
'type' => 'inline',
'foreign_table' => 'tt_content',
'foreign_field' => 'tx_myext_irre_parent',
'foreign_record_defaults' => array(
'colPos' => '56'
)
),
),
this will set the colPos select field in the newly created IRRE element to "5"
'foreign_record_defaults' => array(
'colPos' => '-1'
)
There seems to happen a trim of the value down to the first character. It happens here somewhere:
typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php, line 290:
$nodeFactory = GeneralUtility::makeInstance(NodeFactory::class);
$childArray = $nodeFactory->create($formData)->render();
While in $formData['inlineRelatedRecordToRender'], the colPos-value is still intact,
it is trimmed down to the first character in the returned $childArray
I think the value shouldn't be trimmed, but left untouched.