You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An exception 'Unable to call method of a non-object.' is thrown by Symfony\Component\ExpressionLanguage\Node\GetAttrNode when using this keyword in an Expression constraint when embeded in AtLeastOneOf
How to reproduce
When validating an entity with this kind of constraint:
Since the AtLeastOneOfValidator validates the sub-constraint without context, $variables['this'] = $this->context->getObject(); in Symfony\Component\Validator\Constraints\ExpressionValidator results in a null value
The text was updated successfully, but these errors were encountered:
… constraints (xabbuh)
This PR was merged into the 5.1 branch.
Discussion
----------
[Validator] propagate the object being validated to nested constraints
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#39145
| License | MIT
| Doc PR |
Commits
-------
8c1bac9 propagate the object being validated to sub-constraints
Symfony version(s) affected: 5.1
Description
An exception 'Unable to call method of a non-object.' is thrown by
Symfony\Component\ExpressionLanguage\Node\GetAttrNode
when usingthis
keyword in an Expression constraint when embeded in AtLeastOneOfHow to reproduce
When validating an entity with this kind of constraint:
Since the AtLeastOneOfValidator validates the sub-constraint without context,
$variables['this'] = $this->context->getObject();
inSymfony\Component\Validator\Constraints\ExpressionValidator
results in a null valueThe text was updated successfully, but these errors were encountered: