-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[3.0] [Validator] Remove Blank/NotBlank constraint #12300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So for required fields, devs have to add the |
Exactly. As I said, they can use other means (such as Type and Length validation) to validate a value more specifically. |
But I think there is an inconsistency in this idea: One the one hand you say, empty fields are represented as |
@Tobion You are completely right. Obviously we can't do this without breaking BC, so this is postponed to 3.0. |
This would first require to stop ignoring empty strings in other validators, considering only |
@stof ;) |
I just realize the nonsense of Blank vs NotBlank: |
@webmozart so when deprecating NotBlank, shouldn't Blank be deprecated as well? |
Also the current issue description makes no sense. If we want to deprecate these constraints, then it must be done before 3.0. So the milestone is wrong. |
The issue is that we cannot deprecate things without providing a replacement for the feature. and the new way cannot be built without BC break, so it cannot be built before 3.0. There is no way to deprecate it in 2.x for removal in 3.0 |
NotBlank should be deprecated. It's behavior is weird (as mentioned — |
This commit actually broke everything: 639513a |
👍 |
3.0 is already here. |
@TomasVotruba The problem is, as @stof said, that we can only deprecate these constraints if we remove the Any other solutions or can we only do this as part of the 4.0 release? |
@webmozart Ok, that sound clear to me. Can prepare PR if this gets accepted. |
I'm 👎 here in the way it is described, what we should do is:
|
Let's close here in favour of #27876. |
I think that the Blank/NotBlank constraints should be removed in 3.0. It's not quite clear what the constraints do (see #9961) and I guess we're better off if we just removed it. People can use other, more specific constraints instead, such as True, Length, Count etc.
The text was updated successfully, but these errors were encountered: