8000 [Form] Removed legacy check in `ValidationListener` by HeahDude · Pull Request #36428 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Removed legacy check in ValidationListener #36428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Form] Removed legacy check in ValidationListener
  • Loading branch information
HeahDude committed Apr 11, 2020
commit e479e51f7c0de69d646813e52fefb40590c132dc
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