Bug #81893

ck_editor: Linefeeds added after each save

Added by Michael Perlbach over 4 years ago. Updated 4 months ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Start date:
2017-07-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Hi,

I already made the experience in TYPO3 7.6.x and now it is also happening in TYPO 8.7.2:

Whenever I save Text in ck_editor an additional line feed <p> </p> is added after
each line. Also is every "<br />"-tag converted into a "<p></p>"-wrapper around the line.

In order to prevent this behaviour I added the following directive to my page tsconfig:

RTE.default {
proc {
dontConvBRtoParagraph = 1
preserveTables = 1
typolist = 0
}
}

which has no effect at all.

I am not in the mood nor do I have the time fiddling around with dozens of possible
ts-optioons and trying to find a solution by trial-and-error. This is so basic - there
should be a straightforward solution (which I did not find so far).


Related issues

Related to TYPO3 Core - Bug #80778: CKeditor inserts empty paragraphs in FlexFormsClosed2017-04-09

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

Actions
Related to TYPO3 Core - Bug #81748: custom yaml not loaded in flexform field for cke editorClosed2017-06-29

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

Actions
#1

Updated by Wouter Wolters over 4 years ago

  • Status changed from New to Needs Feedback

Do you use Flux as extension?

#2

Updated by Michael Perlbach over 4 years ago

Hi Wouter,

I do not use Flux.

I only use DCE (1.4.8) and included
- Fluid Content Elements (fluid_styled_content)
- Fluid Content Elements CSS (optional) (fluid_styled_content)

Regards
Michael

#3

Updated by Riccardo De Contardi about 4 years ago

  • Related to Bug #80778: CKeditor inserts empty paragraphs in FlexForms added
#4

Updated by Jasmina Ließmann about 4 years ago

I can confirm the problem, but only for my special case. I have several custom elements (new CTypes) that can contain IRRE elements. The IRRE element itself has a text field, which should contain an RTE only on a particular CType.

By using a configuration like this, I get duplicate p-tags each time I save the particular CType.

$GLOBALS['TCA']['tt_content']['types']['ce_custom'] = [
    'columnsOverrides' => [
        'tx_domain_model_records' => [
            'config' => [
                'overrideChildTca' => [
                    'columns' => [
                        'text' => [
                            'config' => [
                                'enableRichtext' => true,
                                'richtextConfiguration' => 'default',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
],

If I activate the RTE for the text field of the IRRE element in general (and not just for the specific CType), the problem does not occur.

Tested with:
  • TYPO3 CMS 8.7.5-dev
  • rte_ckeditor (8.7.5)
  • fluid_styled_content (8.7.5)

I don't use Flux or DCE. In normal content elements like 'text' or 'textmedia' the problem does not occur as well.

#5

Updated by Jasmina Ließmann about 4 years ago

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

Updated by Riccardo De Contardi about 4 years ago

  • Related to Bug #71769: Newline appended to RTE fields after save added
#7

Updated by Riccardo De Contardi about 4 years ago

  • Related to deleted (Bug #71769: Newline appended to RTE fields after save)
#8

Updated by Ralf Zimmermann about 4 years ago

I use the columnsOverrides and overrideChildTca TCA feature to enable the RTE on the "description" field of a sys_file_reference.

Configuration/TCA/Overrides/tt_content.php:

    \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
        $GLOBALS['TCA']['tt_content'],
        [
            'types' => [
                'textmedia' => [
                    'columnsOverrides' => [
                        'assets' => [
                            'config' => [
                                'overrideChildTca' => [
                                    'columns' => [
                                        'description' => [
                                            'config' => [
                                                'enableRichtext' => true,
                                                'richtextConfiguration' => 'default'
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ]
    );

When saving, the DataHandler does not know what was overwritten by the parent element:
https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7-4/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L1770

The DataHandler takes the "default" configuration of "$GLOBALS['TCA']['sys_file_reference']['types'][2]['columnsOverrides']['description']['config']" and ignores the "overrideChildTca" configuration from the parent element.
Therefore, "'enableRichtext' => true" is not set and the DataHandler does not execute the required RTE transformations.

#9

Updated by Riccardo De Contardi almost 4 years ago

  • Status changed from Needs Feedback to New
#10

Updated by Kevin Quiatkowski over 3 years ago

I have this Problem on TYPO3 8.7.9 with News 6.2.0
If I add a Content element that has a ck_editor to a news entry, I get the new lines on every save.

#11

Updated by Riccardo De Contardi over 2 years ago

Is this still an issue? I tried to use

- TYPO3 9.5.5
- Ext:news 7.1.0

I followed the following steps:

1) create a sysfolder
2) create a news record
3) tab "content elements" > create a "text" content element
4) write some text in it
5) Save

So far, I've not experienced that each save adds a line. Is a different test required?

#12

Updated by Benni Mack almost 2 years ago

  • Related to Bug #81748: custom yaml not loaded in flexform field for cke editor added
#13

Updated by Benni Mack almost 2 years ago

  • Status changed from New to Needs Feedback

Should be fixed with https://review.typo3.org/c/Packages/TYPO3.CMS/+/60902 - right? (applied to 10, 9 and 8 in August 2019 release)

#14

Updated by Kevin Quiatkowski almost 2 years ago

I currently have this bug sometimes in a 9.5.13. Looks like there will be added a <p> </p> every time there is more than one line break between 2 p blocks. With each save there comes an additional line of empty p. Switching to the source view and delete every line break between the p's is a workaround.

#15

Updated by Hugo Laporte almost 2 years ago

  • TYPO3 Version changed from 8 to 9
  • PHP Version changed from 7.0 to 7.2

I also have this issue with tt_news and gridelements on the ckeditor content field. Every time I save it's adding :

<p>&nbsp;</p>

between my paragraphs. Kind of annoying.

My only solution so far was to remove all the empty paragraphs by javascript. The problem does'nt appear on a core content element like "Regular Text Element".

TYPO3 9.5.13
tt_news 9.5.3
gridelements 9.3.0

#16

Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Needs Feedback to New
#17

Updated by Michael Sollmann over 1 year ago

Can confirm this with

TYPO3 9.5.13
tt_news 9.5.3
gridelements 9.3.0

Gridelements are installed but not used here.

#19

Updated by Riccardo De Contardi 12 months ago

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

Updated by Riccardo De Contardi 12 months ago

  • Status changed from Needs Feedback to Closed

I think it is safe to close this issue for now (long time without feedback and seems related to a deprecated feature)

If you think that this is the wrong decision, please reopen it or ping me and I'll do

Thank you.

#21

Updated by Daniel Ostmann 9 months ago

I can confirm this issue in TYPO3 9.5.24.

I've configured the sys_file_reference.description to use the RTE (code above: #note-8). After saving the Editor adds <p>&nbsp;</p> at top and bottom and replaces every linebreak with <p>&nbsp;</p> as well.

If activate the RTE in the TCA of sys_file_reference directly (no columnsOverrides), it works.

#22

Updated by Ben Robinson 5 months ago

I can also confirm this issue in TYPO3 9.5.27, same conditions as described by Daniel. Can someone reopen this who has permissions to do so?

#23

Updated by Riccardo De Contardi 5 months ago

  • Status changed from Closed to New
#24

Updated by Ben Robinson 4 months ago

Addendum: I had tried to activate the RTE for selected content elements in the description field of sys_file_reference and encountered the same problem as Ralf Zimmermann, that after saving new paragraphs were created in the RTE.

Afterwards I manually extended sys_file_reference with a new field "bodytext" ...

CREATE TABLE sys_file_reference (
    bodytext mediumtext,
);
    // Configure new fields:
    $newfields = array(
        'bodytext' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.text',
            'config' => array(
                'type' => 'text',
                'cols' => '80',
                'rows' => '15',
                'wrap' => 'off',
                'softref' => 'typolink_tag,images,email[subst],url',
                'format' => 'html',
                'enableRichtext' => true,
                'richtextConfiguration' => 'default'
            )
        )
    );
    // Add new fields:
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $newfields);

... and assigned this field to my content element:

    $GLOBALS['TCA']['tt_content']['types']['mycontentelement'] = array(
        'showitem' => '
            --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
            --palette--;;general,
            --palette--;;headers,
            image,
        ',
        'columnsOverrides' => [
            'image' => [
                'config' => [
                    'overrideChildTca' => [
                        'types' => [
                            2 => [
                                'showitem' => '
                                    bodytext,
                                    --palette--;;basicoverlayPalette,--palette--;;filePalette
                                ',
                                'columnsOverrides' => [
                                    'description' => [
                                        'config' => [
                                            'placeholder' => '',
                                            'mode' => '',
                                            'enableRichtext' => 1,
                                            'richtextConfiguration' => 'default',
                                        ],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    );

This worked now. The above TCA example contains both cases:
1. the working new field "bodytext" with RTE
2. the problematic "description" field with RTE, which creates empty lines when saving.

Also available in: Atom PDF