8000 [Form] Adapted FormValidator to latest changes in the Validator · symfony/symfony@1858b96 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1858b96

Browse files
committed
[Form] Adapted FormValidator to latest changes in the Validator
1 parent 1f752e8 commit 1858b96

File tree

2 files changed

+136
-154
lines changed

2 files changed

+136
-154
lines changed

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,12 @@ public function validate($form, Constraint $constraint)
5151

5252
if ($form->isSynchronized()) {
5353
// Validate the form data only if transformation succeeded
54-
$path = $this->context->getPropertyPath();
55-
$graphWalker = $this->context->getGraphWalker();
5654
$groups = self::getValidationGroups($form);
5755

58-
if (!empty($path)) {
59-
$path .= '.';
60-
}
61-
6256
// Validate the data against its own constraints
6357
if (self::allowDataWalking($form)) {
6458
foreach ($groups as $group) {
65-
$graphWalker->walkReference($form->getData(), $group, $path . 'data', true);
59+
$this->context->validate($form->getData(), 'data', $group, true);
6660
}
6761
}
6862

@@ -72,7 +66,7 @@ public function validate($form, Constraint $constraint)
7266
foreach ($constraints as $constraint) {
7367
foreach ($groups as $group) {
7468
if (in_array($group, $constraint->groups)) {
75-
$graphWalker->walkConstraint($constraint, $form->getData(), $group, $path . 'data');
69+
$this->context->validateValue($form->getData(), $constraint, 'data', $group);
7670

7771
// Prevent duplicate validation
7872
continue 2;

0 commit comments

Comments
 (0)
0