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

Custom message not working for Constraint_length #22

Open
Martimiz opened this issue Dec 2, 2014 · 1 comment
Open

Custom message not working for Constraint_length #22

Martimiz opened this issue Dec 2, 2014 · 1 comment

Comments

@Martimiz
Copy link

Martimiz commented Dec 2, 2014

Although the constraint is set to data-parsley-maxlength / data-parsley-minlength / data-parsley-length correctly,
the message uses data-parsley-max-message / data-parsley-min-message / data-parsley-range-message /

This is because the message attribute is based on Constraint::getConstraintName(), and that is set to min/max/range in Constraint_length, Constraint_check and Constraint_value, where only the last one is correct.

If range/max/min is to be kept in place for all three constraints, then a solution could be to either

  • enable some sort of mapping the constraintname to the proper parsley constraintname.
  • move the message attribute construction from ZenValidatorConstraint::applyParsley() to the applyParsley() function in each module

Happy to create a pull request, if you agree on one of these options (or something else)

Martine

@lekoala
Copy link
Collaborator

lekoala commented Dec 17, 2014

Maybe we could just have a function "setCustomMessage" called in applyParsley with a default behaviour and override when necessary ?

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

2 participants