#89744Reset enableRichtext to false in a type makes it impossible to save linebreaks
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:*
field-before-save.png
*After saving:*
field-after-save.png
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.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.