mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00: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…
x
Reference in New Issue
Block a user