Refactoring the form validation in the action to be more readable and in the SS standards based on the code review

This commit is contained in:
tdenev 2020-04-07 22:46:32 +01:00
parent a1f0f2f45d
commit 1d85981537

View File

@ -165,7 +165,9 @@ class Page_Controller extends ContentController
if ($check) {
$validationResult = new ValidationResult();
$validationResult->addFieldError('Email', 'This email already exists');
throw new ValidationException($validationResult);
$form->setSessionValidationResult($validationResult);
$form->setSessionData($form->getData());
return $this->redirectBack();
}