NotNullConstraintValidator doesn't catch empty strings, only list/complex data types

Created on 9 March 2023, over 1 year ago

Problem/Motivation

I applied NotNull to a string value, since we do not have a NotEmptyString constraint. This constraint validator states "Overrides the symfony validator to handle empty Typed Data structures."

    $typed_data = $this->getTypedData();
    if (($typed_data instanceof ListInterface || $typed_data instanceof ComplexDataInterface) && $typed_data->isEmpty()) {
      $value = NULL;
    }

However it only calls isEmpty if the typed data object is a list/sequence or complex/mapping data type.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

10.1 ✨

Component
Typed dataΒ  β†’

Last updated 2 days ago

  • Maintained by
  • πŸ‡¦πŸ‡ΉAustria @fago
Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024