mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
a1f0f2f45d
commit
1d85981537
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user