Skip to content

Commit

Permalink
[Form] Removed legacy check in ValidationListener
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Apr 11, 2020
1 parent 5da141b commit e479e51
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public function validateForm(FormEvent $event)
foreach ($this->validator->validate($form) as $violation) {
// Allow the "invalid" constraint to be put onto
// non-synchronized forms
// ConstraintViolation::getConstraint() must not expect to provide a constraint as long as Symfony\Component\Validator\ExecutionContext exists (before 3.0)
$allowNonSynchronized = (null === $violation->getConstraint() || $violation->getConstraint() instanceof Form) && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();
$allowNonSynchronized = $violation->getConstraint() instanceof Form && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();

$this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);
}
Expand Down

0 comments on commit e479e51

Please sign in to comment.