mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-06-27 23:19:36 +02:00
Merge pull request #1882 from mfendeksilverstripe/master
Limits added to collateDescendants
This commit is contained in:
commit
5ec0f2555c
|
@ -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