mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #871 from quantum-dragons/pulls/fix-form-vallidation-exception-message
Fix exception error message fails when error in upload file.
This commit is contained in:
commit
b1a04d6563
@ -256,7 +256,9 @@ JS
|
||||
$upload->loadIntoFile($_FILES[$field->Name], $file, $foldername);
|
||||
} catch (ValidationException $e) {
|
||||
$validationResult = $e->getResult();
|
||||
$form->addErrorMessage($field->Name, $validationResult->message(), 'bad');
|
||||
foreach ($validationResult->getMessages() as $message) {
|
||||
$form->sessionMessage($message['message'], ValidationResult::TYPE_ERROR);
|
||||
}
|
||||
Controller::curr()->redirectBack();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user