diff --git a/code/Model/SiteTree.php b/code/Model/SiteTree.php index 55592efb..23878d8d 100755 --- a/code/Model/SiteTree.php +++ b/code/Model/SiteTree.php @@ -1256,6 +1256,12 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi */ public function collateDescendants($condition, &$collator) { + // apply reasonable hierarchy limits + $threshold = Config::inst()->get(Hierarchy::class, 'node_threshold_leaf'); + if ($this->numChildren() > $threshold) { + return false; + } + $children = $this->Children(); if ($children) { foreach ($children as $item) {