Skip to content

Commit

Permalink
FIX: handle error response in ss4
Browse files Browse the repository at this point in the history
message has become 'messages' and is now a private property of ValidationResult.
  • Loading branch information
adrexia committed Aug 23, 2017
1 parent 9cd209b commit 212f2e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/SingleObjectAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ public function doSave($data, $form)
$form->saveInto($object);
$object->write();
} catch (ValidationException $e) {
$form->sessionMessage($e->getResult()->message(), 'bad');
$result = $e->getResult();
$form->loadMessagesFrom($result);

$responseNegotiator = new PjaxResponseNegotiator(array(
'CurrentForm' => function () use (&$form) {
return $form->forTemplate();
Expand Down

0 comments on commit 212f2e1

Please sign in to comment.