Permalink
Browse files

MINOR Avoid nesting metadata properties in TreeDropdownField, setting…

… classname in metadata even if no record is pre-selected
  • Loading branch information...
1 parent 7924ce9 commit 7e01c40770698b6a3e5f9f7abe0ceca360f8e4dd @chillu chillu committed Oct 29, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 forms/TreeDropdownField.php
@@ -151,11 +151,10 @@ public function Field() {
}
// 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',

0 comments on commit 7e01c40

Please sign in to comment.