From cf9aba394480b98a20a47c17348c84db50477d01 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 12 Jan 2009 03:17:44 +0000 Subject: [PATCH] Removed unnecessary db query in CMS tree generation git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69983 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Hierarchy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/Hierarchy.php b/core/model/Hierarchy.php index 44ab47cff..6fc419573 100644 --- a/core/model/Hierarchy.php +++ b/core/model/Hierarchy.php @@ -159,7 +159,7 @@ class Hierarchy extends DataObjectDecorator { protected function markingFinished() { // Mark childless nodes as expanded. foreach($this->markedNodes as $id => $node) { - if(!$node->numChildren()) { + if(!$node->isExpanded() && !$node->numChildren()) { $node->markExpanded(); } }