BUGFIX Fixed DropdownField handling of Iterator objects rather than arrays in the newly created getSource()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64318 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-15 21:44:38 +00:00
parent 96ec288cd7
commit 2ddc6f13e8

View File

@ -110,10 +110,10 @@ class DropdownField extends FormField {
* @return array * @return array
*/ */
function getSource() { function getSource() {
if($this->getHasEmptyDefault()) { if(is_array($this->source) && $this->getHasEmptyDefault()) {
return array(""=>$this->emptyString) + (array)$this->source; return array(""=>$this->emptyString) + (array)$this->source;
} else { } else {
return (array)$this->source; return $this->source;
} }
} }