Project

General

Profile

Actions

Bug #92892

closed

RTE in TCA of type='flex' in combination with type='array' in flexform adds empty <p>&nbsp ;</p>

Added by Paul Kamma over 3 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2020-11-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
rte, flexform
Complexity:
Is Regression:
Sprint Focus:

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>&nbsp ;</p>.
Looks like that it the <p>&nbsp ;</p> appears when it converts the empty lines to the empty paragraphs. They are not written in the DB.

Actions #1

Updated by Benjamin Franzke over 3 years ago

Does the behavior perist, when you add

<richtextConfiguration>default</richtextConfiguration>

into <config>?

Actions #2

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.

Actions #3

Updated by Paul Kamma almost 3 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.

Actions #4

Updated by Gerrit Code Review over 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

Actions #5

Updated by Paul Kamma over 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?

Actions #6

Updated by Riccardo De Contardi about 1 month ago

Just a note: if I am not wrong <TCEforms> is not evaluated anymore since TYPO3 12 - see
https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/FlexForms/Index.html#flexforms

Actions #7

Updated by Riccardo De Contardi about 1 month ago

  • Status changed from Under Review to Closed
  • Tags changed from rte flexform to rte, flexform

I close this issue - as I wrote on my previous comment the removal of <TCEforms> is part of the upgrade path of the CMS and documented.

If you think that this is the wrong decision or experience the issue again (e.g. on TYPO3 12 or later) and there is still work to do on this topic, please reopen it or open a new issue with a reference to this one.

Thank you.

Actions

Also available in: Atom PDF