mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Pre-cache page version numbers when querying CMS tree for query efficiency
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@69982 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9274c1f234
commit
508aa8a80b
@ -149,6 +149,10 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
$this->generateDataTreeHints();
|
||||
$this->generateTreeStylingJS();
|
||||
|
||||
// Pre-cache sitetree version numbers for querying efficiency
|
||||
Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage");
|
||||
Versioned::prepopulate_versionnumber_cache("SiteTree", "Live");
|
||||
|
||||
return $this->getSiteTreeFor("SiteTree");
|
||||
}
|
||||
|
||||
@ -175,6 +179,10 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
* Returns a filtered Site Tree
|
||||
*/
|
||||
public function filtersitetree() {
|
||||
// Pre-cache sitetree version numbers for querying efficiency
|
||||
Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage");
|
||||
Versioned::prepopulate_versionnumber_cache("SiteTree", "Live");
|
||||
|
||||
$className = 'SiteTree';
|
||||
$rootID = null;
|
||||
$obj = $rootID ? $this->getRecord($rootID) : singleton($className);
|
||||
|
Loading…
Reference in New Issue
Block a user