Skip to content

FIX: N+1 in admin themes page #32763

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

Merged
merged 2 commits into from
May 19, 2025
Merged

FIX: N+1 in admin themes page #32763

merged 2 commits into from
May 19, 2025

Conversation

lis2
Copy link
Contributor

@lis2 lis2 commented May 16, 2025

strict_loading was added to prevent it happening in the future. Few adjustments had to be made:

  • include color_scheme and color_scheme_colors, also for parent and child themes;
  • internal translations were using preload_fields, but it was too deep to correctly use preloaded tables. I had to pass preloaded_locale_fields manually;
  • include theme in color_scheme.

Before:
Screenshot 2025-05-15 at 3 43 47 pm

After:
Screenshot 2025-05-16 at 11 29 00 am

`strict_loading` was added to prevent it happening in the future. Few adjustments had to be made:
-  include color_scheme and color_scheme_colors, also for parent and child themes;
- internal translations were using preload_fields, but it was too deep to correctly use preloaded tables. I had to pass `preloaded_locale_fields` manually;
- pass theme object to colour scheme serializer. It is because theme load color scheme and then color scheme serializer search again for theme name.
@lis2 lis2 merged commit 76e1373 into main May 19, 2025
17 checks passed
@lis2 lis2 deleted the themes-strict-loading branch May 19, 2025 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants