Issue Bug Closed

#89429Empty p tags added in RTE when changing type "passthrough" to "text" via "columnsOverrides"

Sven Burkert 10/16/19, 12:29 updated 04/20/25, 15:00

Description

To reproduce:
1) Add a new (but disabled with type “passthrough”) text field for e.g. tt_content:

$tempColumns = [
    'tx_myext_text' => [
        'exclude' => 1,
        'label'   => 'Text',
        'config' => [
            'type' => 'passthrough',
            'cols' => 40,
            'rows' => 15,
            'enableRichtext' => 1,
            'richtextConfiguration' => 'default',
        ],
    ],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $tempColumns, 0);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
    'tt_content',
    'tx_myext_text',
    '',
    'after:CType'
);

2) Change this field to type “text” in “columnsOverrides” for a specific content element:

$GLOBALS['TCA']['tt_content']['types']['textpic'] = array_replace_recursive(
    $GLOBALS['TCA']['tt_content']['types']['textpic'], [
        'columnsOverrides' => [
            'tx_myext_text' => [
                'config' => [
                    'type' => 'text',
                ],
            ],
        ],
    ]
);
3) Create a new content element “textpic” in TYPO3 BE, write some text into this new RTE textfield. Important: Text must have more than one paragraph (e.g.

aaa

bbb

)
4) Save this content element several times.
5) Result: Every time you save, an empty p-tag is added:
<p>aaa</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>bbb</p>

This bug occures both in macOS and Windows 10, both TYPO3 8 and TYPO3 9.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.