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
@ -96,7 +96,7 @@ class Group extends DataObject
|
|||||||
|
|
||||||
return $doSet;
|
return $doSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getDecodedBreadcrumbs()
|
private function getDecodedBreadcrumbs()
|
||||||
{
|
{
|
||||||
$list = Group::get()->exclude('ID', $this->ID);
|
$list = Group::get()->exclude('ID', $this->ID);
|
||||||
@ -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,
|
||||||
@ -332,7 +332,7 @@ class Group extends DataObject
|
|||||||
// Now set all children groups as a new foreign key
|
// Now set all children groups as a new foreign key
|
||||||
$familyIDs = $this->collateFamilyIDs();
|
$familyIDs = $this->collateFamilyIDs();
|
||||||
$result = $result->forForeignID($familyIDs);
|
$result = $result->forForeignID($familyIDs);
|
||||||
|
|
||||||
return $result->where($filter);
|
return $result->where($filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user