diff --git a/core/model/Hierarchy.php b/core/model/Hierarchy.php index 4d8217885..35b59cb05 100644 --- a/core/model/Hierarchy.php +++ b/core/model/Hierarchy.php @@ -158,7 +158,11 @@ class Hierarchy extends DataObjectDecorator { if($children) { foreach($children as $child) { if(!$this->markingFilter || $this->markingFilterMatches($child)) { - $child->markUnexpanded(); + if($child->numChildren()) { + $child->markUnexpanded(); + } else { + $child->markExpanded(); + } $this->markedNodes[$child->ID] = $child; } }