-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] fixed default parameter value in UniqueEntityValidator #19227
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
[DoctrineBridge] fixed default parameter value in UniqueEntityValidator #19227
Conversation
HeahDude
commented
Jun 29, 2016
Q | A |
---|---|
Branch? | 3.1 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #19209 |
License | MIT |
Doc PR | ~ |
Confirmed by @nicolas-grekas that the remaining failure in |
@nicolas-grekas Is that normal that tests pass in high depth in travis? Shouldn't the validator dependency in the doctrine bridge be updated? |
Ok I got it, tests are not running on 3.1, so maybe we should add a conflict? |
@@ -127,6 +127,10 @@ public function validate($entity, Constraint $constraint) | ||
$errorPath = null !== $constraint->errorPath ? $constraint->errorPath : $fields[0]; | ||
$invalidValue = isset($criteria[$errorPath]) ? $criteria[$errorPath] : $criteria[$fields[0]]; | ||
|
||
if (is_object($invalidValue) && !method_exists($invalidValue, '__toString')) { | ||
$invalidValue = sprintf('Object of class "%s" identified by "%s"', get_class($entity), implode(', ', $class->getIdentifierValues($entity))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use this in the default message by including the placeholder?
Thank you @HeahDude. |
…tityValidator (HeahDude) This PR was merged into the 3.1 branch. Discussion ---------- [DoctrineBridge] fixed default parameter value in UniqueEntityValidator | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19209 | License | MIT | Doc PR | ~ Commits ------- 40c0c52 [DoctrineBridge] fixed default parameter value in UniqueEntityValidator
Tests may fail after #19240, do they? |