mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Allow a validation error to be thrown when a DataObject is saved in ComplexTableField.
From: Andrew Short <andrewjshort@gmail.com> (from r95034) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97431 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c826191897
commit
9e55bc17a7
@ -809,9 +809,9 @@ class ComplexTableField_ItemRequest extends RequestHandler {
|
|||||||
*/
|
*/
|
||||||
function saveComplexTableField($data, $form, $request) {
|
function saveComplexTableField($data, $form, $request) {
|
||||||
$dataObject = $this->dataObj();
|
$dataObject = $this->dataObj();
|
||||||
$form->saveInto($dataObject);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$form->saveInto($dataObject);
|
||||||
$dataObject->write();
|
$dataObject->write();
|
||||||
} catch(ValidationException $e) {
|
} catch(ValidationException $e) {
|
||||||
$form->sessionMessage($e->getResult()->message(), 'bad');
|
$form->sessionMessage($e->getResult()->message(), 'bad');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user