-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: Use Hierarchy::prepopulate_numchildren_cache in tree-generation #2266
Conversation
Only relevant if silverstripe/silverstripe-framework#8380 is avialable, however coded defensively so it can be merged before that PR if needs be. See silverstripe/silverstripe-framework#8379
code/Controllers/CMSMain.php
Outdated
Hierarchy::prepopulate_numchildren_cache(SiteTree::class, Versioned::DRAFT); | ||
} | ||
$filter = $this->getSearchFilter(); | ||
SiteTree::singleton()->prepopulateTreeDataCache(null, [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be consistent here and use $this->config()->get('tree_class')
to decide what we are caching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would make sense. singleton($this->config()->get('tree_class'))
most likely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We can probably squish this into a single commit |
Only relevant if silverstripe/silverstripe-framework#8380 is avialable,
however coded defensively so it can be merged before that PR if needs
be.
See silverstripe/silverstripe-framework#8379
Parent issue