Bug #80778

CKeditor inserts empty paragraphs in FlexForms

Added by R3 H6 over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Start date:
2017-04-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If CKeditor is used for a FlexForm text field, empty paragraphs are added after/during saving.

The problem must be related with the line-breaks.

Example:

Saving 1st time:

        <sheet index="5d7ebe118aa5b02493a1e5fc2989fae4">
            <language index="lDEF">
                <field index="settings.finishers.Confirmation.message">
                    <value index="vDEF">&lt;p&gt;a&lt;/p&gt;

&lt;p&gt;b&lt;/p&gt;

&lt;p&gt;c&lt;/p&gt;
</value>
                </field>
            </language>
        </sheet>

Saving 2nd time:

        <sheet index="5d7ebe118aa5b02493a1e5fc2989fae4">
            <language index="lDEF">
                <field index="settings.finishers.Confirmation.message">
                    <value index="vDEF">&lt;p&gt;a&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;b&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;c&lt;/p&gt;
</value>
                </field>
            </language>
        </sheet>


Files

test.zip (4.88 KB) test.zip Jan Kornblum, 2019-06-18 10:42

Related issues

Related to TYPO3 Core - Bug #79216: rte_ckeditor generates empty lines between paragraphsClosed2017-01-09

Actions
Related to TYPO3 Core - Bug #81893: ck_editor: Linefeeds added after each saveNew2017-07-17

Actions
Related to TYPO3 Core - Bug #81952: CKeditor inserts just in Workspace empty paragraphs in FlexFormsClosed2017-07-24

Actions
Related to TYPO3 Core - Bug #89923: Empty p-Tag appended to RTE fields after saveClosed2019-12-11

Actions
#1

Updated by Patric Schumann over 4 years ago

I can see this behavior only in flux fields from the fluidtypo3 extension as stated here https://github.com/FluidTYPO3/flux/issues/1388.

When using a RTE-field configured by a flexform in a regular extbase-plugin this behavior wont show up. still have to check if the config finally gets loaded with 8.7 or if this is still buggy but thats another issue.

kind regards
Patric

#2

Updated by R3 H6 over 4 years ago

This happens in an custom form element using only core functionality.

You can grab following extension https://github.com/r3h6/TYPO3.EXT.form_confirmation_finisher and activate the rte in the yaml configuration.

Then on the form content element you can observe the behavior.

#3

Updated by Simon Würstle over 4 years ago

I can confirm this issue with powermail plugin flexform fields (TYPO3 8.7.1)

#4

Updated by Marcelo Vetter over 4 years ago

Simon Würstle wrote:

I can confirm this issue with powermail plugin flexform fields (TYPO3 8.7.1)

I can also confirm this issue in Powermail

#5

Updated by Lars Houmark over 4 years ago

We had this issue mainly with DCE fields that has a RTE editor.

The following configuration in the RTE field solved it:

<config>
  <enableRichtext>1</enableRichtext>
</config>

Maybe this should somehow be solved by the core to avoid "broken functionality" in "random" places upon upgrading.

#6

Updated by Benni Mack over 4 years ago

  • Target version changed from 8 LTS to next-patchlevel
#7

Updated by Christian Kuhn over 4 years ago

  • Related to Bug #79216: rte_ckeditor generates empty lines between paragraphs added
#8

Updated by Riccardo De Contardi about 4 years ago

  • Related to Bug #81893: ck_editor: Linefeeds added after each save added
#9

Updated by dermueller no-lastname-given about 4 years ago

I can confirm the problem when adding CKeditor to a Gridelement via Flexform.

This code produces empty paragraphs on saving:

<?xml version="1.0" encoding="UTF-8"?>
<T3DataStructure>
    <meta>
        <langDisable>0</langDisable>
    </meta>
    <ROOT type="array">
        <type>array</type>
        <el type="array">
            <text>
                <TCEforms type="array">
                    <config type="array">
                        <type>text</type>
                        <cols>48</cols>
                        <rows>5</rows>
                    </config>
                    <label>Text</label>
                    <defaultExtras>richtext[*]:rte_transform[flag=rte_enabled]</defaultExtras>
                </TCEforms>
            </text>
        </el>
    </ROOT>
</T3DataStructure>

BUT... the solution from Lars Houmark seems to solve it

<?xml version="1.0" encoding="UTF-8"?>
<T3DataStructure>
    <meta>
        <langDisable>0</langDisable>
    </meta>
    <ROOT type="array">
        <type>array</type>
        <el type="array">
            <text>
                <TCEforms type="array">
                    <config type="array">
                        <type>text</type>
                        <cols>48</cols>
                        <rows>5</rows>
                        <enableRichtext>1</enableRichtext>
                    </config>
                    <label>Text</label>
                    <defaultExtras>richtext[*]:rte_transform[flag=rte_enabled]</defaultExtras>
                </TCEforms>
            </text>
        </el>
    </ROOT>
</T3DataStructure>
#10

Updated by R3 H6 almost 4 years ago

Insert the config

<enableRichtext>1</enableRichtext>

solved the problem for me as well.

#11

Updated by Riccardo De Contardi almost 4 years ago

  • Related to Bug #81952: CKeditor inserts just in Workspace empty paragraphs in FlexForms added
#12

Updated by Frank no-lastname-given over 3 years ago

This also and definitely happens under typo3 8.7.10 with dce 1.5.2:

text</p><p>more text

becomes:

text</p>
<p>&nbsp;</p>
<p>more text

or:

text</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>more text

Rah.
Just found while trying for a second time that the solution for dce also works here (i wondered why it wouldn't first, but it does):

<enableRichtext>1</enableRichtext>

inside typo3conf/ext/gridelements/Configuration/FlexForms/default_flexform_configuration.xml

#13

Updated by Andreas Fernandez almost 3 years ago

I also found that bug in a current project, using 8.7.19.

Current case: I have a custom TCA for use in IRRE with a type and a field "bodytext" that has no configured RTE by default. In some other TCA I use that IRRE foo and enable the RTE by using columnsOverrides.
If I enable the RTE by default, the issue disappears. It seems something goes wrong with columnsOverrides/irre_foo/config/overrideChildTca/columns/bodytext/config/enableRichtext = true

#14

Updated by Benni Mack over 2 years ago

  • Target version changed from next-patchlevel to Candidate for patchlevel
#15

Updated by Jan Kornblum over 2 years ago

Adding `<enableRichtext>1</enableRichtext>` doesn't solve the problem for me at a plugins flexform field in 8.7.13.

#16

Updated by Jan Kornblum over 2 years ago

...and even in 9.5.4 this isn't solved yet.

#17

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60902

#18

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60902

#19

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60902

#20

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60902

#21

Updated by Benni Mack over 2 years ago

I found out that the issue is related to flexforms, having RTE in a sheet. When a field is not in a specific sheet (that is sDEF, as the example shows from above), all works fine.

Please please review this patch for sheets as well Jan Schröder Kornblum, could you upload your demo extension to have people test this?

#22

Updated by DMK E-BUSINESS GmbH over 2 years ago

We experienced the same bug in TYPO3 8.7 with gridelements (gridelement with an RTE) and CK editor. In our case the problem is not the bug found here, it's gridelements. You can find the issue here (https://gitlab.com/coderscare/gridelements/issues/46) including a patch.

#23

Updated by Jan Kornblum over 2 years ago

Hi all! Attached you'll find the demo extension. Just install, place the plugin on any page and put some text inside the plugins rte field and save several times.

#24

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61059

#25

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61089

#26

Updated by Benni Mack over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#27

Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61089

#28

Updated by Benni Mack over 2 years ago

  • Status changed from Under Review to Resolved
#29

Updated by Benni Mack almost 2 years ago

  • Status changed from Resolved to Closed
#30

Updated by JZ no-lastname-given over 1 year ago

Unfortunately, I'm still facing with this bug in Typo3 v 9.5.9 (it works fine in version 8), so I just want to know if the patch has been included in Typo3 9.5.9 as well.

Analyzing my DataHandler.php file, it seems to be the case, but once again using Typo3 9.5.9 and CKE I get these empty lines in FE.

I'm not using extension like "flux", however, grid and DCE extensions are used.

Thaks in advance for your reply.
Regards

#31

Updated by Benni Mack over 1 year ago

  • Related to Bug #89923: Empty p-Tag appended to RTE fields after save added

Also available in: Atom PDF