Skip to content
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

Merged
merged 3 commits into from
Sep 25, 2018

Conversation

sminnee
Copy link
Member

@sminnee sminnee commented Sep 18, 2018

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

Hierarchy::prepopulate_numchildren_cache(SiteTree::class, Versioned::DRAFT);
}
$filter = $this->getSearchFilter();
SiteTree::singleton()->prepopulateTreeDataCache(null, [
Copy link
Contributor

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.

Copy link
Member Author

@sminnee sminnee Sep 25, 2018

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?

Copy link
Member Author

@sminnee sminnee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sminnee
Copy link
Member Author

sminnee commented Sep 25, 2018

We can probably squish this into a single commit

@maxime-rainville maxime-rainville merged commit 5bfc37f into silverstripe:4 Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants