Skip to content

Commit

Permalink
Fix exception error message fails when error in upload file.
Browse files Browse the repository at this point in the history
  • Loading branch information
ishannz committed Mar 26, 2019
1 parent 5c8f086 commit 3615f41
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 @@ -252,7 +252,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 3615f41

Please sign in to comment.