From df26613d8b25f51c961fbb9ff237feb3ac6d49d2 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Mon, 27 Apr 2009 04:43:40 +0000 Subject: [PATCH] MINOR: fixed undefined error when member list failed --- code/editor/EditableMemberListField.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/editor/EditableMemberListField.php b/code/editor/EditableMemberListField.php index c2140f9..e6c4f88 100644 --- a/code/editor/EditableMemberListField.php +++ b/code/editor/EditableMemberListField.php @@ -21,14 +21,14 @@ class EditableMemberListField extends EditableFormField { } 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) { $value = Convert::raw2sql($data[$this->Name]); $member = DataObject::get_one('Member', "Member.ID = {$value}"); - return $member->getName(); + return ($member) ? $member->getName() : ""; } } ?> \ No newline at end of file