#73125500 Error in GroupElement.php due to group db fields in flexform containers
Description
There is a bug in the typo3/sysext/backend/Classes/Form/Element/GroupElement.php on line 278. I think it is only happening with nested flexforms.
if (!$this_table && $onlySingleTableAllowed) {
$this_table = $allowed[0];
}
$itemArray[] = array('table' => $this_table, 'id' => $this_uid);
if (!$disabled && $show_thumbs) {
$rr = BackendUtility::getRecordWSOL($this_table, $this_uid);
$this_table should be a string as expected from getRecordWSOL, but as it is coming from a trimExplode it is actually a array. On line 55 you can see.
$allowed = GeneralUtility::trimExplode(',', $config['allowed'], true);
A simple array_shift would solve this issue.
This issue is hiding another issue with container elements in flexform using group-> db fields. The elements in the containers are not being prepend with the table name and this cause later a problem.
Example:
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<ROOT>
<type>array</type>
<el>
<settings.container>
<TCEforms>
<label>Download Container</label>
</TCEforms>
<section>1</section>
<type>array</type>
<el>
<item>
<type>array</type>
<label>New Document</label>
<title>New Document</title>
<el>
<document>
<TCEforms>
<label>Document</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>tx_dms_domain_model_document</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>1</minitems>
</config>
</TCEforms>
</document>
<languageContainer>
<TCEforms>
<label>More Languages Documents</label>
</TCEforms>
<section>1</section>
<type>array</type>
<el>
<item>
<type>array</type>
<label>New Localization</label>
<title>New Localization</title>
<el>
<document>
<TCEforms>
<label>Document</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>tx_dms_domain_model_document</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>1</minitems>
</config>
</TCEforms>
</document>
</el>
</item>
</el>
</languageContainer>
</el>
</item>
</el>
</settings.container>
</el>
</ROOT>
</T3DataStructure>
This produces a pi_flexform like
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
<data>
<sheet index="sDEF">
<language index="lDEF">
<field index="settings.container">
<el index="el">
<section index="1">
<itemType index="item">
<el>
<field index="document">
<value index="vDEF">2</value>
</field>
<field index="languageContainer">
<el index="el">
<section index="1">
<itemType index="item">
<el>
<field index="document">
<value index="vDEF">3</value>
</field>
</el>
</itemType>
<itemType index="_TOGGLE">0</itemType>
</section>
</el>
</field>
</el>
</itemType>
<itemType index="_TOGGLE">0</itemType>
</section>
</el>
</field>
</language>
</sheet>
</data>
</T3FlexForms>
And produces the error.