mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX If DropdownField->Field() lack of source checking before looping through it
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64320 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5865fd19d1
commit
972558df3f
@ -70,6 +70,7 @@ class DropdownField extends FormField {
|
|||||||
$options = '';
|
$options = '';
|
||||||
|
|
||||||
$source = $this->getSource();
|
$source = $this->getSource();
|
||||||
|
if($source) {
|
||||||
foreach($source as $value => $title) {
|
foreach($source as $value => $title) {
|
||||||
$selected = ($value == $this->value) ? 'selected' : null;
|
$selected = ($value == $this->value) ? 'selected' : null;
|
||||||
if($selected && $this->value != 0) {
|
if($selected && $this->value != 0) {
|
||||||
@ -85,6 +86,7 @@ class DropdownField extends FormField {
|
|||||||
$title
|
$title
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'class' => trim($this->extraClass()) ? $this->extraClass() : null,
|
'class' => trim($this->extraClass()) ? $this->extraClass() : null,
|
||||||
|
Loading…
Reference in New Issue
Block a user