Issue Bug Closed

#101286RTE validation broken when field is required

Christoph Erdmann 07/07/23, 12:44 updated 10/28/24, 20:47

Description

Hey guys,

when declaring a field in TCA as RTE and adding the option required => true, the validation is broken:

TCA:

'content' => [
    'exclude' => true,
    'label' => 'LLL:EXT:my_ext/Resources/Private/Language/locallang_db_event.xlf:content.label',
    'config' => [
        'type' => 'text',
        'enableRichtext' => true,
        'required' => true,
    ],
],

SQL schema:

    ...
    content text NULL DEFAULT NULL
    ...

When creating a new record, the field is not marked as invalid, even as it should be (because of required => true):

clipboard-202307071440-pl0st.png

After putting some content in, it gets marked as invalid. Thus the record cannot be saved:

clipboard-202307071442-wn1b8.png

If you need feedback, just reach out. Thanks for looking into this and fixing/support.

Reviews 0

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