From a34ff7589bab12f4ec1625e0b1d87e9c654a7d8a Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 2 Oct 2008 10:09:29 +0000 Subject: [PATCH] BUGFIX: Removed notice-level errors in ListboxField git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63527 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/ListboxField.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/forms/ListboxField.php b/forms/ListboxField.php index 51d69bfe7..3c067a0bc 100755 --- a/forms/ListboxField.php +++ b/forms/ListboxField.php @@ -37,21 +37,21 @@ class ListboxField extends DropdownField { $this->name .= '[]'; } + $options = ""; + // We have an array of values if(is_array($this->value)){ // Loop through and figure out which values were selected. foreach($this->source as $value => $title) { - // Loop through the array of values to find out if this value is selected. + $selected = ""; foreach($this->value as $v){ - if($value == $v){ + if($value == $v) { $selected = " selected=\"selected\""; break; - }else{ - $selected = ""; - } - } + } + } $options .= "$title\n"; } }else{