MINOR Avoid nesting metadata properties in TreeDropdownField, setting classname in metadata even if no record is pre-selected

This commit is contained in:
Ingo Schommer 2011-10-29 21:56:00 +02:00
parent 7924ce9f74
commit 7e01c40770

View File

@ -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',