From 2ddc6f13e8e023e68e75bc4936701bc528b05b43 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 15 Oct 2008 21:44:38 +0000 Subject: [PATCH] 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 --- forms/DropdownField.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/forms/DropdownField.php b/forms/DropdownField.php index d018c3c77..7116bce3e 100755 --- a/forms/DropdownField.php +++ b/forms/DropdownField.php @@ -93,7 +93,7 @@ class DropdownField extends FormField { 'disabled' => $this->disabled ? 'disabled' : null, 'tabindex' => $this->getTabIndex() ); - + return $this->createTag('select', $attributes, $options); } @@ -110,10 +110,10 @@ class DropdownField extends FormField { * @return array */ function getSource() { - if($this->getHasEmptyDefault()) { + if(is_array($this->source) && $this->getHasEmptyDefault()) { return array(""=>$this->emptyString) + (array)$this->source; } else { - return (array)$this->source; + return $this->source; } }