Skip to content

Commit

Permalink
Merge pull request #871 from quantum-dragons/pulls/fix-form-vallidati…
Browse files Browse the repository at this point in the history
…on-exception-message

Fix exception error message fails when error in upload file.
  • Loading branch information
robbieaverill authored Mar 26, 2019
2 parents ad9612c + 3615f41 commit b1a04d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/Control/UserDefinedFormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ public function process($data, $form)
$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;
}
Expand Down

0 comments on commit b1a04d6

Please sign in to comment.