mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
BUGFIX Using try/catch in MemberTableField->saveComplexTableField() similiar to parent implementation, which means trying to save a Member duplicate doesn't end up in a fatal error (fixes #5444)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@103336 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
597b9cd2f0
commit
a6db618c12
@ -350,8 +350,14 @@ class MemberTableField extends ComplexTableField {
|
|||||||
// Needs to write before saveInto() to ensure the 'Groups' TreeMultiselectField saves
|
// Needs to write before saveInto() to ensure the 'Groups' TreeMultiselectField saves
|
||||||
$childData->write();
|
$childData->write();
|
||||||
|
|
||||||
$form->saveInto($childData);
|
try {
|
||||||
$childData->write();
|
$form->saveInto($childData);
|
||||||
|
$childData->write();
|
||||||
|
} catch(ValidationException $e) {
|
||||||
|
var_dump($e->getResult());
|
||||||
|
$form->sessionMessage($e->getResult()->message(), 'bad');
|
||||||
|
return Director::redirectBack();
|
||||||
|
}
|
||||||
|
|
||||||
$closeLink = sprintf(
|
$closeLink = sprintf(
|
||||||
'<small><a href="' . $_SERVER['HTTP_REFERER'] . '" onclick="javascript:window.top.GB_hide(); return false;">(%s)</a></small>',
|
'<small><a href="' . $_SERVER['HTTP_REFERER'] . '" onclick="javascript:window.top.GB_hide(); return false;">(%s)</a></small>',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user