mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX: run member CMS validator when editing via groups (fixes #9… (#9255)
FIX: run member CMS validator when editing via groups (fixes #9184)
This commit is contained in:
commit
190b2f2842
@ -166,10 +166,10 @@ class Group extends DataObject
|
|||||||
/** @var GridFieldDetailForm $detailForm */
|
/** @var GridFieldDetailForm $detailForm */
|
||||||
$detailForm = $config->getComponentByType(GridFieldDetailForm::class);
|
$detailForm = $config->getComponentByType(GridFieldDetailForm::class);
|
||||||
$detailForm
|
$detailForm
|
||||||
->setValidator(Member_Validator::create())
|
|
||||||
->setItemEditFormCallback(function ($form) use ($group) {
|
->setItemEditFormCallback(function ($form) use ($group) {
|
||||||
/** @var Form $form */
|
/** @var Form $form */
|
||||||
$record = $form->getRecord();
|
$record = $form->getRecord();
|
||||||
|
$form->setValidator($record->getValidator());
|
||||||
$groupsField = $form->Fields()->dataFieldByName('DirectGroups');
|
$groupsField = $form->Fields()->dataFieldByName('DirectGroups');
|
||||||
if ($groupsField) {
|
if ($groupsField) {
|
||||||
// If new records are created in a group context,
|
// If new records are created in a group context,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user