Added {{ value }} message placeholder to UniqueEntityValidator#15279
Added {{ value }} message placeholder to UniqueEntityValidator#15279jperovic wants to merge 1 commit into
Conversation
|
Just wanted to ask quick question here, to which I didn't find any answer in CONTRIBUTING document. When I run "phpunit" command, it works until it gets stuck with # Symfony\Component\Console\Helper\QuestionHelper::validateAttempts()
while (null === $attempts || $attempts--) {
if (null !== $error) {
$this->writeError($output, $error);
}
try {
return call_user_func($question->getValidator(), $interviewer());
} catch (\Exception $error) {
}
}Is this known limitation? I have |
|
@jperovic that's a bug. I'm looking into this. |
|
@jakzal Cool, thanks :) |
|
Hello, thanks for this ! 👍 Just a quick note: UniqueEntityValidator can have several fields. As such, one should be able to refer to all these fields in the validation message eg. "The combination of {{ field1 }} and {{ field2 }} should be unique.". Also, see #15201. You both address the same issue. |
|
@jakzal Are you still looking at this bug? |
|
Thank you @jperovic. |
This PR was merged into the 3.1 branch. Discussion ---------- Properly format value in UniqueEntityValidator | Q | A | | --- | --- | | Branch? | 3.1 | | Bug fix? | yes | | New feature? | no | | BC breaks? | no | | Deprecations? | no | | Tests pass? | yes | | Fixed tickets | / | | License | MIT | This PR fixes a small issue introduced in #15279. Having an array in a field considered for a unique check causes an array to string conversion error in the translator. This can be avoided by formatting the value parameter with `formatValue`. Commits ------- 9043a55 Properly format value in UniqueEntityValidator
Apologize if I missed something. This is my first contribution to a large scale project.