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

[validator] not required and empty fields should not be validated by domain #171

Closed
durandx opened this issue Aug 7, 2015 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@durandx
Copy link

durandx commented Aug 7, 2015

Example: field with domain DO_EMAIL not required, the email validator is still applyed.
Its value is "" but the check is

        if (property.value === undefined || property.value === null) {
          return true;
        }
        return emailValidation(property.value, validator.options);

https://github.com/KleeGroup/focus/blob/24a5a975b949fed3eb3d491235e4cbf67e741e3b/src/definition/validator/validate.js#L54

@pierr
Copy link
Contributor

pierr commented Aug 7, 2015

Not required and empty fields.

@pierr pierr added the Critical label Aug 7, 2015
@pierr
Copy link
Contributor

pierr commented Aug 7, 2015

Two things:

  • the value '' shoud be undefined when the form is read
  • the validator should't deal with empty cases, it should not be validated when a field is undefined

@durandx durandx changed the title [validator] not required field should not be validated by domain [validator] not required and empty fields should not be validated by domain Aug 7, 2015
@pierr pierr self-assigned this Aug 7, 2015
@pierr pierr modified the milestone: Focus v0.9.0 Aug 7, 2015
pierr added a commit to klee-contrib/focus-components that referenced this issue Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants