Skip to content

RTE custom regex validation fails #19044

Closed
@tomvanenckevort

Description

@tomvanenckevort

Which Umbraco version are you using?

13.8.0

Bug summary

When enabling custom validation on a doc type property that uses the RTE (TinyMCE) property editor, the validation will fail because it validates the JSON value, rather than the markup entered in the RTE.

Specifics

No response

Steps to reproduce

  • Create a new doc type with a property that uses the built-in Richtext editor data type.
  • Enable validation for that property and set it to use custom validation.
  • Enter a regular expression, for example this one that will check that the length does not exceed 250 characters: ^.{0,250}$
  • Save the doc type and create a new node using this doc type.
  • Enter some text in the RTE, but make sure it does not exceed 250 characters.
  • Try to Save & Publish the node and see the validation failure pop up.

Image

Expected result / actual result

  • Expected: when the content in the RTE matches the specified regular expression, it should save & publish without errors.
  • Actual: the node fails to save & publish.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions