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

Don’t preload defined Twig globals when preloading singles #15468

Merged
merged 2 commits into from
Aug 3, 2024

Conversation

bencroker
Copy link
Contributor

This PR ignores handles that are defined Twig globals when preloading singles as fallback values. Without this, Craft::$app->getEntries()->getSingleEntriesByHandle() is unnecessarily called on values such as craft, currentSite, currentUser, etc. This is a micro optimisation but feels like a better way of loading fallbacks.

If merged, this should be carried over to the 5.x branch as well.

@brandonkelly brandonkelly changed the base branch from 4.x to 4.11 August 3, 2024 13:50
@brandonkelly brandonkelly merged commit 6745ffb into craftcms:4.11 Aug 3, 2024
8 checks passed
@brandonkelly
Copy link
Member

Good call, thanks! merged for 4.11 and 5.3.

@bencroker bencroker deleted the patch-64 branch August 3, 2024 17:14
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