mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-06-29 07:59:37 +02:00
Children of the site tree are no longer listed only for the purpose of counting them. count($this->Children()) creates an array list of children which has serious performance consequences if there are lot of children present. On the other hand $this->numChildren() runs a count query which is much faster and eat’s less memory.
This commit is contained in:
parent
a24a3af1b1
commit
b442bad767
|
@ -1956,7 +1956,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||||
'CMSMain.NEWPAGE',
|
'CMSMain.NEWPAGE',
|
||||||
array('pagetype' => $this->i18n_singular_name())
|
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')) {
|
if(!Config::inst()->get('URLSegmentFilter', 'default_allow_multibyte')) {
|
||||||
$helpText .= $helpText ? '<br />' : '';
|
$helpText .= $helpText ? '<br />' : '';
|
||||||
$helpText .= _t('SiteTreeURLSegmentField.HelpChars', ' Special characters are automatically converted or removed.');
|
$helpText .= _t('SiteTreeURLSegmentField.HelpChars', ' Special characters are automatically converted or removed.');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user