mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX Setting default $groups in MemberTableField::AddForm() in addition to MemberTableField_Popup::__construct() - this was broken by r99777 (from r99993)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111617 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a1cbf0cddf
commit
65aa49d564
@ -327,6 +327,18 @@ class MemberTableField extends ComplexTableField {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AddForm() {
|
||||||
|
$form = parent::AddForm();
|
||||||
|
|
||||||
|
// Set default groups - also implemented in MemberTableField_Popup::__construct()
|
||||||
|
if($this->group) {
|
||||||
|
$groupsField = $form->Fields()->dataFieldByName('Groups');
|
||||||
|
if($groupsField) $groupsField->setValue($this->group->ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $form;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same behaviour as parent class, but adds the
|
* Same behaviour as parent class, but adds the
|
||||||
* member to the passed GroupID.
|
* member to the passed GroupID.
|
||||||
@ -428,6 +440,7 @@ class MemberTableField_Popup extends ComplexTableField_Popup {
|
|||||||
|
|
||||||
function __construct($controller, $name, $fields, $validator, $readonly, $dataObject) {
|
function __construct($controller, $name, $fields, $validator, $readonly, $dataObject) {
|
||||||
$group = ($controller instanceof MemberTableField) ? $controller->getGroup() : $controller->getParent()->getGroup();
|
$group = ($controller instanceof MemberTableField) ? $controller->getGroup() : $controller->getParent()->getGroup();
|
||||||
|
// Set default groups - also implemented in AddForm()
|
||||||
if($group) {
|
if($group) {
|
||||||
$groupsField = $fields->dataFieldByName('Groups');
|
$groupsField = $fields->dataFieldByName('Groups');
|
||||||
if($groupsField) $groupsField->setValue($group->ID);
|
if($groupsField) $groupsField->setValue($group->ID);
|
||||||
|
Loading…
Reference in New Issue
Block a user