mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Avoid nesting metadata properties in TreeDropdownField, setting classname in metadata even if no record is pre-selected
This commit is contained in:
parent
7924ce9f74
commit
7e01c40770
@ -151,11 +151,10 @@ class TreeDropdownField extends FormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO Implement for TreeMultiSelectField
|
// TODO Implement for TreeMultiSelectField
|
||||||
if($record) {
|
$metadata = array(
|
||||||
$metadata = array('id' => $record->ID, 'metadata' => array('ClassName' => $record->ClassName));
|
'id' => $record ? $record->ID : null,
|
||||||
} else {
|
'ClassName' => $record ? $record->ClassName : $this->sourceObject
|
||||||
$metadata = null;
|
);
|
||||||
}
|
|
||||||
|
|
||||||
return $this->createTag(
|
return $this->createTag(
|
||||||
'div',
|
'div',
|
||||||
|
Loading…
Reference in New Issue
Block a user