-
Notifications
You must be signed in to change notification settings - Fork 820
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
Refactor tree-generation prepopulation #8391
Comments
Paging @silverstripe/core-team especially @tractorcow. |
Wouldn't fluent ideally replace the versioned implementation of this, to avoid running two expensive queries across potentially all records? That seems incompatible with the event hook approach ( |
Update: With the project we're testing against (17k records), |
Fluent is caching a different set of data: hierarchy is caching numChildren, fluent other is caching isLocalisedOnStage. The numChildren caching would ideally incorporate any query modification that fluent necessitates, which my second implementation (that takes the stageChildren query of a single record and transforms it into a precaching query for all ParentIDs) does. |
OK this now blocks merge of Scopey's Fluent PR. |
OK the first cut of this is implemented, it affects a few modules:
Strictly speaking, the best merge order is probably fluent & versioned, then framework, then CMS |
The only PR still open on this one is tractorcow-farm/silverstripe-fluent#468. |
@maxime-rainville the fluent PR has been merged, so I'll close this ticket - feel free to reopen if I've misunderstood your comment |
Problem
Right now
CMSMain::SiteTreeAsUL()
calls some Versioned prepopulation in order to generate the site tree without an egregious number of queries. This works okay, but has a couple of challenges:This relates to silverstripe/silverstripe-cms#2250.
Recommended fix
This logic should be wrapped into a prepopulateTreeDataCache method:
singleton('SiteTree')->prepopulateTreeDataCache(DataList $recordList = null, array $options)
Hierarchy
can provide this method, since it relates to trees, and other extensions can hook into the behaviour by definingonPrepopulateTreeDataCache
. The existing behaviour can be shifted to Versioned::onPrepopulateTreeDataCache, and the fluent ticket above could be implemented by providing this.Pull requests
The text was updated successfully, but these errors were encountered: