Skip to content

Commit

Permalink
switch the context when validating nested forms
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jun 4, 2020
1 parent 9f3b43a commit 2c634e0
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -90,6 +90,7 @@ public function validate($form, Constraint $formConstraint)
// in different steps without breaking early enough
$this->resolvedGroups[$field] = (array) $group;
$fieldFormConstraint = new Form();
$this->context->setNode($this->context->getValue(), $field, $this->context->getMetadata(), $this->context->getPropertyPath());
$validator->atPath(sprintf('children[%s]', $field->getName()))->validate($field, $fieldFormConstraint);
}
}
Expand Down Expand Up @@ -129,6 +130,7 @@ public function validate($form, Constraint $formConstraint)
if ($field->isSubmitted()) {
$this->resolvedGroups[$field] = $groups;
$fieldFormConstraint = new Form();
$this->context->setNode($this->context->getValue(), $field, $this->context->getMetadata(), $this->context->getPropertyPath());
$validator->atPath(sprintf('children[%s]', $field->getName()))->validate($field, $fieldFormConstraint);
}
}
Expand Down

0 comments on commit 2c634e0

Please sign in to comment.