Skip to content

Fix mandatory RTE validation#16962

Merged
Migaroez merged 3 commits intov13/devfrom
v13/bugfix/rte-required-validation
Aug 26, 2024
Merged

Fix mandatory RTE validation#16962
Migaroez merged 3 commits intov13/devfrom
v13/bugfix/rte-required-validation

Conversation

@bergmania
Copy link
Copy Markdown
Member

@bergmania bergmania commented Aug 26, 2024

Fixes #15993

Description

This fixes a bug, where the mandatory check did not work on RTEs, after the markdown have been wrapped in json.

To fix it, a new custom RichTextRequiredValidator have been introduced. It inherits the original RequiredValidator and passes the markdown to that.

Test

  • Setup a doc type with a RTE and make it mandatory.
  • Check that you get an correct validation message when publishing an empty RTE.
image

Notes for when merged to v14

  • In v14, we do not need to inject ILocalizedTextService into RichTextRequiredValidator. So we should introduce an overload of the constructor that do not use this, and obsolete the one in this PR

…htext object (still with json) can be required or not. We are now testing the markdown needs to have a value
Copy link
Copy Markdown
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Code looks good
✅ Tests out as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants