mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
96ec288cd7
commit
2ddc6f13e8
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user