mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Fix exception error message fails when error in upload file.
This commit is contained in:
parent
5c8f086f3e
commit
3615f416e3
@ -252,7 +252,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