mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
MINOR: fixed undefined error when member list failed
This commit is contained in:
parent
91386c7cf7
commit
df26613d8b
@ -21,14 +21,14 @@ class EditableMemberListField extends EditableFormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFormField() {
|
function getFormField() {
|
||||||
return new DropdownField( $this->Name, $this->Title, Member::mapInGroups($this->getSetting($this->GroupID)));
|
return ($this->getSetting($this->GroupID)) ? new DropdownField( $this->Name, $this->Title, Member::mapInGroups($this->getSetting($this->GroupID))) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getValueFromData($data) {
|
function getValueFromData($data) {
|
||||||
$value = Convert::raw2sql($data[$this->Name]);
|
$value = Convert::raw2sql($data[$this->Name]);
|
||||||
|
|
||||||
$member = DataObject::get_one('Member', "Member.ID = {$value}");
|
$member = DataObject::get_one('Member', "Member.ID = {$value}");
|
||||||
return $member->getName();
|
return ($member) ? $member->getName() : "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user