mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
BUGFIX: fixed memberlist field
This commit is contained in:
parent
6e3f9668c0
commit
9179149446
@ -197,6 +197,9 @@ class UserDefinedForm_Controller extends Page_Controller {
|
|||||||
foreach($this->Fields() as $field) {
|
foreach($this->Fields() as $field) {
|
||||||
|
|
||||||
$fieldToAdd = $field->getFormField();
|
$fieldToAdd = $field->getFormField();
|
||||||
|
|
||||||
|
if(!$fieldToAdd) break;
|
||||||
|
|
||||||
$fieldValidationOptions = array();
|
$fieldValidationOptions = array();
|
||||||
|
|
||||||
// Set the Error Messages
|
// Set the Error Messages
|
||||||
|
@ -10,8 +10,19 @@ class EditableMemberListField extends EditableFormField {
|
|||||||
|
|
||||||
static $plural_name = 'Member list fields';
|
static $plural_name = 'Member list fields';
|
||||||
|
|
||||||
|
function ExtraOptions() {
|
||||||
|
$groupID = ($this->getSetting('GroupID')) ? $this->getSetting('GroupID') : 0;
|
||||||
|
$groups = DataObject::get("Group");
|
||||||
|
if($groups) $groups = $groups->toDropdownMap('ID', 'Title');
|
||||||
|
$fields = new FieldSet(
|
||||||
|
new DropdownField("Fields[$this->ID][CustomSettings][GroupID]", _t('EditableFormField.GROUP', 'Group'), $groups, $groupID)
|
||||||
|
);
|
||||||
|
$fields->merge(parent::ExtraOptions());
|
||||||
|
|
||||||
|
return $fields;
|
||||||
|
}
|
||||||
function getFormField() {
|
function getFormField() {
|
||||||
return ($this->getSetting($this->GroupID)) ? new DropdownField( $this->Name, $this->Title, Member::mapInGroups($this->getSetting($this->GroupID))) : false;
|
return ($this->getSetting('GroupID')) ? new DropdownField( $this->Name, $this->Title, Member::mapInGroups($this->getSetting('GroupID'))) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getValueFromData($data) {
|
function getValueFromData($data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user