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
|
||||
if($record) {
|
||||
$metadata = array('id' => $record->ID, 'metadata' => array('ClassName' => $record->ClassName));
|
||||
} else {
|
||||
$metadata = null;
|
||||
}
|
||||
$metadata = array(
|
||||
'id' => $record ? $record->ID : null,
|
||||
'ClassName' => $record ? $record->ClassName : $this->sourceObject
|
||||
);
|
||||
|
||||
return $this->createTag(
|
||||
'div',
|
||||
|
Loading…
Reference in New Issue
Block a user