Project

General

Profile

Actions

Bug #101286

closed

Epic #99669: CKEditor5 Collection

RTE validation broken when field is required

Added by Christoph Erdmann over 1 year ago. Updated 25 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2023-07-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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):

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

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


Files

clipboard-202307071440-pl0st.png (20.5 KB) clipboard-202307071440-pl0st.png Christoph Erdmann, 2023-07-07 12:40
clipboard-202307071442-wn1b8.png (23.2 KB) clipboard-202307071442-wn1b8.png Christoph Erdmann, 2023-07-07 12:42

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #100838: RTE field not marked as requiredClosed2023-05-08

Actions
Related to TYPO3 Core - Bug #98538: FormEngine state not updated anymore with CKEditor5Closed2022-10-05

Actions
Related to TYPO3 Core - Bug #105505: Required field validation broken on RTE fields (12.4.17)Resolved2024-10-28

Actions
Has duplicate TYPO3 Core - Bug #103533: TCA type=text + enableRichtext=true cannot be requiredClosed2024-04-04

Actions
Actions #1

Updated by Christoph Erdmann over 1 year ago

Just noticed, that the record gets saved, when saving is triggered via onChange => 'reload' on another property.

Actions #2

Updated by Christoph Erdmann over 1 year ago

Update after 12.4.3:

Main issue is fixed. Thanks.
Didn't notice, there was already an issue for that as it is closed (https://forge.typo3.org/issues/100838). Sorry.

Another issue remains:
When the RTE field is 'required' => true and a new record is created, it is possible to save the record without filling out the required field. The exclamation mark indicator for failed validation is missing in this case to.

When editing an existing record and emptying the field, the validation works as expected.

Actions #3

Updated by Benjamin Franzke about 1 year ago

  • Parent task set to #99669
Actions #4

Updated by Benjamin Franzke about 1 year ago

  • Related to Bug #100838: RTE field not marked as required added
Actions #5

Updated by Benjamin Franzke about 1 year ago

  • Related to Bug #98538: FormEngine state not updated anymore with CKEditor5 added
Actions #6

Updated by Georg Ringer 8 months ago

  • Has duplicate Bug #103533: TCA type=text + enableRichtext=true cannot be required added
Actions #7

Updated by Riccardo De Contardi 5 months ago

Also happens on v.11 - see #103533

Actions #8

Updated by Garvin Hicking 5 months ago

Since the field is nullable via its SQL definition, have you tried specifying default => '' in TCA? Or could changing the SQL type to "not null default ''" change this?

Actions #9

Updated by Christoph Erdmann 5 months ago

I checked with TYPO3 12.4.16 right now and it seems that all issues are fixed.

Actions #10

Updated by Garvin Hicking 5 months ago

  • Status changed from New to Closed

Great, closing the issue then, thanks for reporting back! :)

Actions #11

Updated by cosmoblonde GmbH 26 days ago

This issue needs to be re-opened as it started breaking again with 12.4.17!
I have tested and can confirm it was working with 12.4.16 and before.

Actions #12

Updated by Garvin Hicking 26 days ago

Please open a follow-up/fresh issue. Please tell a minimal reproducible example, especially what your TCA 'default' option is set to.

Actions #13

Updated by cosmoblonde GmbH 25 days ago · Edited

Meanwhile, I have found the cause for this issue due to commit https://github.com/typo3/typo3/commit/e9904c0e8d (which is was part of release 12.4.17) to avoid race conditions.
I have added a comment to that commit and created a new ticket #105505

Actions #14

Updated by Garvin Hicking 25 days ago

  • Related to Bug #105505: Required field validation broken on RTE fields (12.4.17) added
Actions

Also available in: Atom PDF