Skip to content
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

Unable to set minLength on property #27

Closed
Invis1ble opened this issue May 11, 2018 · 0 comments
Closed

Unable to set minLength on property #27

Invis1ble opened this issue May 11, 2018 · 0 comments

Comments

@Invis1ble
Copy link
Contributor

My form contains RepeatedType of PasswordType:

$builder
    ->add('plainPassword', RepeatedType::class, [
        'type' => PasswordType::class,
    ])
;

validation rules looks like this:

plainPassword:
    - NotBlank: ~
    - Length:
        min: 6
        max: 255

so ValidatorGuesser can't guess length and StringTransformer::addMinLength() doesn't add minLength.

I would suggest to look at attr.minlength option like in addMaxLength() method and, if it not exists, run default algorithm of guessing by validation rules.

nacmartin added a commit that referenced this issue Dec 6, 2018
Fixed `minLength` adding, fixes #27.
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

No branches or pull requests

1 participant