Bug #80778

CKeditor inserts empty paragraphs in FlexForms

Added by R3 H6 over 2 years ago. Updated 4 months ago.

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

100%

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>

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


Related issues

Related to TYPO3 Core - Bug #79216: rte_ckeditor generates empty lines between paragraphs Closed 2017-01-09
Related to TYPO3 Core - Bug #81893: ck_editor: Linefeeds added after each save New 2017-07-17
Related to TYPO3 Core - Bug #81952: CKeditor inserts just in Workspace empty paragraphs in FlexForms Closed 2017-07-24

Associated revisions

Revision d44e84fc (diff)
Added by Benni Mack 4 months ago

[BUGFIX] Use proper configuration when processing FlexForms in DataHandler

This change removes the "TCEforms" option when parsing
FlexForms data in DataHandler, when dealing with FlexForms
that contain sheets.

This way, FlexForms RTE configuration is properly set
and no double spacings for linebreaks are used.

According to the issue, this only happened when
fields specifically within sheets are configured,
for fields without sheets, this has been working
already.

In order to ensure both cases are working, tests
are applied for both variants.

Resolves: #80778
Resolves: #81748
Releases: master, 9.5, 8.7
Change-Id: I38facfa9e1065d4730f895aa178a049c07c443f8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60902
Tested-by: TYPO3com <>
Tested-by: Jan Kornblum <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Jan Kornblum <>
Reviewed-by: Anja Leichsenring <>

Revision eb8842b8 (diff)
Added by Benni Mack 4 months ago

[BUGFIX] Use proper configuration when processing FlexForms in DataHandler

This change removes the "TCEforms" option when parsing
FlexForms data in DataHandler, when dealing with FlexForms
that contain sheets.

This way, FlexForms RTE configuration is properly set
and no double spacings for linebreaks are used.

According to the issue, this only happened when
fields specifically within sheets are configured,
for fields without sheets, this has been working
already.

In order to ensure both cases are working, tests
are applied for both variants.

Resolves: #80778
Resolves: #81748
Releases: master, 9.5, 8.7
Change-Id: I38facfa9e1065d4730f895aa178a049c07c443f8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61059
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

Revision 7f5597e8 (diff)
Added by Benni Mack 4 months ago

[BUGFIX] Use proper configuration when processing FlexForms in DataHandler

This change removes the "TCEforms" option when parsing
FlexForms data in DataHandler, when dealing with FlexForms
that contain sheets.

This way, FlexForms RTE configuration is properly set
and no double spacings for linebreaks are used.

According to the issue, this only happened when
fields specifically within sheets are configured,
for fields without sheets, this has been working
already.

In order to ensure both cases are working, tests
are applied for both variants.

Resolves: #80778
Resolves: #81748
Releases: master, 9.5, 8.7
Change-Id: I38facfa9e1065d4730f895aa178a049c07c443f8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61089
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Patric Schumann over 2 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 2 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 2 years ago

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

#4 Updated by Marcelo Vetter over 2 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 2 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 2 years ago

  • Target version changed from 8 LTS to next-patchlevel

#7 Updated by Christian Kuhn over 2 years ago

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

#8 Updated by Riccardo De Contardi about 2 years ago

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

#9 Updated by dermueller no-lastname-given about 2 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 2 years ago

Insert the config

<enableRichtext>1</enableRichtext>

solved the problem for me as well.

#11 Updated by Riccardo De Contardi almost 2 years ago

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

#12 Updated by Frank no-lastname-given over 1 year 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 about 1 year 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 6 months ago

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

#15 Updated by Jan Kornblum 5 months 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 5 months ago

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

#17 Updated by Gerrit Code Review 5 months 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 5 months 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 5 months 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 4 months 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 4 months 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 Kornblum, could you upload your demo extension to have people test this?

#22 Updated by DMK E-BUSINESS GmbH 4 months 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 4 months 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 4 months 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 4 months 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 4 months ago

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

#27 Updated by Gerrit Code Review 4 months 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 4 months ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF