mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-01 05:39:10 +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
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user