From 212f2e1aa9f0aa9483f5daaccc7dbdb862cd78f5 Mon Sep 17 00:00:00 2001 From: Naomi Guyer Date: Wed, 23 Aug 2017 12:15:08 +1200 Subject: [PATCH] FIX: handle error response in ss4 message has become 'messages' and is now a private property of ValidationResult. --- code/SingleObjectAdmin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/SingleObjectAdmin.php b/code/SingleObjectAdmin.php index 3df07bc..f8c7449 100644 --- a/code/SingleObjectAdmin.php +++ b/code/SingleObjectAdmin.php @@ -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();