Skip to content
Permalink
Browse files

API Make `CMSMain::getSiteTreeFor()` default to `null` nodeCount (#2029)

  • Loading branch information
oilee80 authored and Damian Mooyman committed Nov 27, 2017
1 parent 23771ad commit 1fedc5fc10b6a1d2af417a051d7fe6bd8182b191
Showing with 4 additions and 1 deletion.
  1. +4 −1 code/Controllers/CMSMain.php
@@ -21,6 +21,7 @@
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Control\HTTPResponse_Exception;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Environment;
use SilverStripe\Core\Injector\Injector;
@@ -52,6 +53,7 @@
use SilverStripe\ORM\DB;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\HiddenClass;
use SilverStripe\ORM\Hierarchy;
use SilverStripe\ORM\Hierarchy\MarkedSet;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\ValidationResult;
@@ -462,8 +464,9 @@ public function getSiteTreeFor(
$childrenMethod = null,
$numChildrenMethod = null,
$filterFunction = null,
$nodeCountThreshold = 30
$nodeCountThreshold = null
) {
$nodeCountThreshold = is_null($nodeCountThreshold) ? Config::inst()->get($className, 'node_threshold_total') : $nodeCountThreshold;
// Provide better defaults from filter
$filter = $this->getSearchFilter();
if ($filter) {

0 comments on commit 1fedc5f

Please sign in to comment.
You can’t perform that action at this time.