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);
|
$upload->loadIntoFile($_FILES[$field->Name], $file, $foldername);
|
||||||
} catch (ValidationException $e) {
|
} catch (ValidationException $e) {
|
||||||
$validationResult = $e->getResult();
|
$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();
|
Controller::curr()->redirectBack();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user