Form validation should throw ValidationException instead of calling unexisting method "addErrorMessage()"

This commit is contained in:
botzko 2020-02-21 23:55:38 +00:00
parent 41da6d74fb
commit a1f0f2f45d

View File

@ -163,9 +163,9 @@ class Page_Controller extends ContentController
$check = Member::get()->filter('Email', $data['Email'])->first(); $check = Member::get()->filter('Email', $data['Email'])->first();
if ($check) { if ($check) {
$form->addErrorMessage('Email', 'This email already exists', 'bad'); $validationResult = new ValidationResult();
$validationResult->addFieldError('Email', 'This email already exists');
return $this->redirectBack(); throw new ValidationException($validationResult);
} }