Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce6f148

Browse files
committed
reset the validation context after validating nested constraints
1 parent 1baafff commit ce6f148

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/Validator/Constraints/AtLeastOneOfValidator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ public function validate($value, Constraint $constraint)
4242
continue;
4343
}
4444

45+
$context = $this->context;
4546
$executionContext = clone $this->context;
4647
$executionContext->setNode($value, $this->context->getObject(), $this->context->getMetadata(), $this->context->getPropertyPath());
4748
$violations = $validator->inContext($executionContext)->validate($value, $item, $this->context->getGroup())->getViolations();
49+
$this->context = $context;
4850

4951
if (\count($this->context->getViolations()) === \count($violations)) {
5052
return;

0 commit comments

Comments
 (0)