Skip to content

NotBlank validator should not invalidate null values #27876

Closed
@Taluu

Description

@Taluu

Description
In most validators, there's a failsafe mecanism that prevent the validator from validating if it's a null value, as there's a validator for that (NotNull). I think NotBlank shouldn't bother on null values, especially as NotBlank and NotNull are used together to prevent null values too.

Not really a feature request, but not really a bug too... more like a RFC but for all versions. But I guess this would be a BC break though. :/ So maybe add a deprecated on the validator if it's a null value or something, and remove the null invalidation from the NotBlank on 5.0 ?

Currently, we need to reimplement the validator just to skip null values...

Possible Solution
Either deprecate the validation on null value in NotBlank, or do as in most validators, (if null value, then skip). But as I mentionned, this would probably be a bc break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)Validator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions