Skip to content
Snippets Groups Projects
Commit b7a3308b authored by Georg Ringer's avatar Georg Ringer Committed by Christian Kuhn
Browse files

[BUGFIX] Prevent multiple FlexContainers of same name

Extend the identifier used within the DOM by an additional field, as
already done in #97042 to make flexform sections within inline child
records work.

A styleguide example makes it easy to reproduce the edge case.

Resolves: #100937
Related: #97042
Releases: main, 12.4
Change-Id: I40120ea13b892c6387833dab444dad86951cf96f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85189


Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarcore-ci <typo3@b13.com>
parent 70af8940
Branches
Tags
No related merge requests found
......@@ -71,8 +71,8 @@ class FlexFormSectionContainer extends AbstractContainer
$resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $flexFormContainerContainerResult);
}
$containerId = sprintf('flexform-section-container-%s-%s-%s', $flexFormSheetName, $this->data['fieldName'], $flexFormFieldName);
$sectionContainerId = sprintf('flexform-section-%s-%s-%s', $flexFormSheetName, $this->data['fieldName'], $flexFormFieldName);
$containerId = sprintf('flexform-section-container-%s-%s-%s-%s', $flexFormSheetName, $this->data['fieldName'], $flexFormFieldName, md5($this->data['elementBaseName']));
$sectionContainerId = sprintf('flexform-section-%s-%s-%s-%s', $flexFormSheetName, $this->data['fieldName'], $flexFormFieldName, md5($this->data['elementBaseName']));
$hashedSectionContainerId = 'section-' . md5($sectionContainerId);
// "New container" handling: Creates buttons for each possible container with all relevant information for the ajax call.
......
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<type>array</type>
<el>
<answers>
<type>array</type>
<section>1</section>
<el>
<answer>
<type>array</type>
<title>Answer</title>
<el>
<text>
<label>Text</label>
<config>
<type>input</type>
</config>
</text>
</el>
</answer>
</el>
</answers>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
......@@ -43,12 +43,30 @@ return [
'foreign_table_field' => 'parenttable',
],
],
'inline_2' => [
'label' => 'inline_2',
'config' => [
'type' => 'flex',
'ds' => [
'default' => 'FILE:EXT:styleguide/Configuration/FlexForms/SimpleSection.xml',
],
],
],
'inline_3' => [
'label' => 'inline_3',
'config' => [
'type' => 'flex',
'ds' => [
'default' => 'FILE:EXT:styleguide/Configuration/FlexForms/MultipleSheets.xml',
],
],
],
],
'types' => [
'0' => [
'showitem' => '
inline_1,
inline_1,inline_2,inline_3,
--div--;meta,
disable, sys_language_uid, l10n_parent, l10n_source,
',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment