Bug #89744

Reset enableRichtext to false in a type makes it impossible to save linebreaks

Added by Thomas Goetz 16 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2019-11-22
Due date:
% Done:

0%

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

Description

I used a custom model (lets name it inlineitem), and discovered some strange behaviour.

The inlineitem have field bodytext with this configuration:

'bodytext' => [
    'label' => 'Label',
    'config' => [
        'type' => 'text',
        'enableRichtext' => true,
    ],
],

I'm using this element with different types, so i've set

'ctrl' => [
    'type' => 'type',
    ...
],

and I defined my different types - type 10 is my test-type in this case.
'types' => [
    0 => [
       ...
    ],
    10 => [
        'showitem' => '
            bodytext,
        ',
        'columnsOverrides' => [
            'bodytext' => [
                'label' => '...',
                'description' => '...',
                'config' => [
                    'enableRichtext' => false,
                ]
            ]
        ]
    ]
],

As you can see, enableRichtext is set to true by default and reset back to false in type 10.
After saving the content element with the referenced inlineitem, the field has lost all linebreaks.

Before saving:

After saving:

I am adding the inlineitem in a custom tt_content element and set the inserted elements type via comunsOverrides like this:

'columnsOverrides' => [
    'inlineitem' => [
        'config' => [
            'foreign_record_defaults' => [
                'type' => 10,
            ]
        ]
    ],
]

When I reverse the bodytext configuration and set enableRichtext default to false, everything works fine - the linebreaks are saved.

field-before-save.png View (10.7 KB) Thomas Goetz, 2019-11-22 16:14

field-after-save.png View (9.8 KB) Thomas Goetz, 2019-11-22 16:15

Also available in: Atom PDF