mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Limits added to collateDescendants() to ensure reasonable performance with thousands of pages.
This commit is contained in:
parent
184ec65b7f
commit
42cb0820a2
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user