From b442bad767ac99a8b6804f8282a80a41ae522533 Mon Sep 17 00:00:00 2001 From: Mojmir Fendek Date: Thu, 8 Jun 2017 12:19:27 +1200 Subject: [PATCH] =?UTF-8?q?Children=20of=20the=20site=20tree=20are=20no=20?= =?UTF-8?q?longer=20listed=20only=20for=20the=20purpose=20of=20counting=20?= =?UTF-8?q?them.=20count($this->Children())=20creates=20an=20array=20list?= =?UTF-8?q?=20of=20children=20which=20has=20serious=20performance=20conseq?= =?UTF-8?q?uences=20if=20there=20are=20lot=20of=20children=20present.=20On?= =?UTF-8?q?=20the=20other=20hand=20$this->numChildren()=20runs=20a=20count?= =?UTF-8?q?=20query=20which=20is=20much=20faster=20and=20eat=E2=80=99s=20l?= =?UTF-8?q?ess=20memory.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/model/SiteTree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 11862a63..d4082f99 100755 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1956,7 +1956,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid 'CMSMain.NEWPAGE', array('pagetype' => $this->i18n_singular_name()) ))); - $helpText = (self::config()->nested_urls && count($this->Children())) ? $this->fieldLabel('LinkChangeNote') : ''; + $helpText = (self::config()->nested_urls && $this->numChildren()) ? $this->fieldLabel('LinkChangeNote') : ''; if(!Config::inst()->get('URLSegmentFilter', 'default_allow_multibyte')) { $helpText .= $helpText ? '
' : ''; $helpText .= _t('SiteTreeURLSegmentField.HelpChars', ' Special characters are automatically converted or removed.');