8000 [Validator] gracefully handle transChoice errors by kriswallsmith · Pull Request #6988 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] gracefully handle transChoice errors #6988

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

Merged
merged 1 commit into from
Feb 28, 2013

Conversation

kriswallsmith
Copy link
Contributor

This validator annotation was throwing an error for me:

/** @Assert\Length(min=6, minMessage="Must be 6 characters") */

To avoid this error in the current code I would need to provide a message template that accommodates the minimum length being 1, even though that's not the case.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets ~
License MIT
Doc PR ~

@kriswallsmith
Copy link
Contributor Author

ping @fabpot

Any thoughts on this change? Having to provide a transChoice template when you know what the pluralization is going to be is a pain in the neck.

@kriswallsmith
Copy link
Contributor Author

ping @bschussek too :)

@fabpot
Copy link
Member
fabpot commented Feb 25, 2013

I'm +1 for this change. What do you think @bschussek?

@vicb
Copy link
Contributor
vicb commented Feb 26, 2013

Would this be a common enough use case to be pushed to the translator ?

fabpot added a commit that referenced this pull request Feb 28, 2013
This PR was merged into the 2.2 branch.

Commits
-------

da22926 [Validator] gracefully handle transChoice errors

Discussion
----------

[Validator] gracefully handle transChoice errors

This validator annotation was throwing an error for me:

```
/** @Assert\Length(min=6, minMessage="Must be 6 characters") */
```

To avoid this error in the current code I would need to provide a message template that accommodates the minimum length being 1, even though that's not the case.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

---------------------------------------------------------------------------

by kriswallsmith at 2013-02-25T19:41:51Z

ping @fabpot

Any thoughts on this change? Having to provide a transChoice template when you know what the pluralization is going to be is a pain in the neck.

---------------------------------------------------------------------------

by kriswallsmith at 2013-02-25T19:42:11Z

ping @bschussek too :)

---------------------------------------------------------------------------

by fabpot at 2013-02-25T19:57:08Z

I'm +1 for this change. What do you think @bschussek?

---------------------------------------------------------------------------

by vicb at 2013-02-26T10:44:33Z

Would this be a common enough use case to be pushed to the translator ?
@fabpot fabpot merged commit da22926 into symfony:2.2 Feb 28, 2013
@webmozart
Copy link
Contributor

👍

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

Successfully merging this pull request may close these issues.

4 participants
0