Bug #92892
openRTE in TCA of type='flex' in combination with type='array' in flexform adds empty <p>  ;</p>
0%
Description
I have the following setup to extend a TCA of a Model
$GLOBALS['TCA']['tx_myExtension_domain_model_event']['columns']['attributes']['config'] = [
'type' => 'flex',
'ds' => [
'default' => 'FILE:EXT:myExtension/Configuration/FlexForms/event.xml',
],
];
the flexForm looks like this:
<T3DataStructure>
<ROOT>
<type>array</type>
<el>
<attributes>
<TCEforms>
<section>1</section>
<title>Attributes</title>
<type>array</type>
<el>
<attribute>
<title>Attribute</title>
<type>array</type>
<el>
<info>
<TCEforms>
<label>Copy</label>
<config>
<type>text</type>
<rows>5</rows>
<cols>30</cols>
<eval>trim</eval>
<enableRichtext>true</enableRichtext>
</config>
</TCEforms>
</info>
</el>
</attribute>
</el>
</TCEforms>
</attributes>
</el>
</ROOT>
</T3DataStructure>
When I add a "Attribute" element within the Section and type text with two paragraphs. After saving the RTE creates an Additional paragraph between the two inserted with <p>  ;</p>.
Looks like that it the <p>  ;</p> appears when it converts the empty lines to the empty paragraphs. They are not written in the DB.
Updated by Benjamin Franzke over 3 years ago
Does the behavior perist, when you add
<richtextConfiguration>default</richtextConfiguration>
into <config>
?
Updated by Paul Kamma over 3 years ago
Benjamin Franzke wrote in #note-1:
Does the behavior perist, when you add
[...]
into
<config>
?
Yes it does.
Updated by Paul Kamma over 2 years ago
OK I have to solve this riddle.
After I've stumbled upon this problem again in a new Project but also noticed that it doesn't appeared in an another I've compared the FlexForms and noticed that in the "Buggy" one the XML structure was different.
This one is wrong:
<T3DataStructure>
<ROOT>
<type>array</type>
<el>
<attributes>
<TCEforms>
<section>1</section>
<title>Attributes</title>
<type>array</type>
<el>
<attribute>
<title>Attribute</title>
<type>array</type>
<el>
<info>
<TCEforms>
<label>Copy</label>
<config>
<type>text</type>
<rows>5</rows>
<cols>30</cols>
<eval>trim</eval>
<enableRichtext>true</enableRichtext>
</config>
</TCEforms>
</info>
</el>
</attribute>
</el>
</TCEforms>
</attributes>
</el>
</ROOT>
</T3DataStructure>
and this one is the correct:
<T3DataStructure>
<ROOT>
<type>array</type>
<el>
<attributes>
<section>1</section>
<title>Attributes</title>
<type>array</type>
<el>
<attribute>
<title>Attribute</title>
<type>array</type>
<el>
<info>
<TCEforms>
<label>Copy</label>
<config>
<type>text</type>
<rows>5</rows>
<cols>30</cols>
<eval>trim</eval>
<enableRichtext>true</enableRichtext>
</config>
</TCEforms>
</info>
</el>
</attribute>
</el>
</attributes>
</el>
</ROOT>
</T3DataStructure>
You'll notice that the <TCEforms>
tags disappeared, they caused the strange behaviour, in the Backend the form were rendered without problems but it looks like that parsing after the save (when loading the flexform content) caused an parsing issue and added empty stuff. I don't really know but I'm happy that I found out what caused the problem :)
The issue can be closed.
Updated by Gerrit Code Review about 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73994
Updated by Paul Kamma about 2 years ago
Gerrit Code Review wrote in #note-4:
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73994
So is this actually a bug? Or is it just a preventation to avoid this issue?