Skip to content

🐛 Fixed theme editor launch gate for allowlisted themes on limited plans#27970

Merged
ErisDS merged 1 commit into
TryGhost:mainfrom
magicpages:feat/theme-editor-limit-on-launch
May 29, 2026
Merged

🐛 Fixed theme editor launch gate for allowlisted themes on limited plans#27970
ErisDS merged 1 commit into
TryGhost:mainfrom
magicpages:feat/theme-editor-limit-on-launch

Conversation

@betschki
Copy link
Copy Markdown
Contributor

@betschki betschki commented May 19, 2026

  • the server's POST /themes/upload/ blocks every save by a limited customer using a . sentinel that's never in the allowlist, so editing any theme on a plan with a customThemes limit enabled is rejected regardless of which theme is active
  • the launch gate previously checked the active theme name against the allowlist, so customers whose current theme happened to be allowlisted could enter the editor only to hit a generic "something went wrong" toast on save
  • the gate at all three editor entry points (Change theme menu, installed themes list, /theme/edit/:name deep link) now uses the same . sentinel as the upload endpoint, so the LimitModal fires at launch with the host's customThemes error message instead
feature-gate

Got some code for us? Awesome 🎊!

Please take a minute to explain the change you're making:

  • Why are you making it?
  • What does it do?
  • Why is this something Ghost users or developers need?

Please check your PR against these items:

  • I've read and followed the Contributor Guide
  • I've explained my change
  • I've written an automated test to prove my change works

We appreciate your contribution! 🙏

- the server's POST /themes/upload/ blocks every save by a limited customer using a `.` sentinel that's never in the allowlist, so editing any theme on a plan with customThemes enabled is rejected regardless of which theme is active
- the launch gate previously checked the active theme name against the allowlist, so customers whose current theme happened to be allowlisted could enter the editor only to hit a generic "something went wrong" toast on save
- the gate at all three editor entry points (Change theme menu, installed themes list, /theme/edit/:name deep link) now uses the same `.` sentinel as the upload endpoint, so the LimitModal fires at launch with the host's customThemes error message instead
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

Walkthrough

This PR unifies the theme editor access control by consolidating how three components check editor limits. Previously, the logic conditionally passed either the '.' sentinel or the active theme name based on whether the theme was default or legacy. The change makes all three components (ChangeTheme, DesignAndThemeModal, AdvancedThemeSettings) consistently use the '.' sentinel when calling checkThemeLimitError, removing the conditional branching. Supporting imports are updated by removing isDefaultOrLegacyTheme and introducing isDefaultTheme where needed. A new acceptance test validates that editor access is blocked even when a theme is present in the custom themes allowlist.

Possibly related PRs

  • TryGhost/Ghost#27656: Both PRs modify theme editor launch gating by changing how checkThemeLimitError is computed with the '.' sentinel and extend acceptance coverage for editor blocking when custom themes are limited.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing the theme editor launch gate to properly block allowlisted themes on limited plans by using the '.' sentinel.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly explains the bug fix: the launch gate for the theme editor now uses a '.' sentinel to align with server-side behavior, preventing users from entering the editor only to fail on save.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ErisDS ErisDS merged commit 6fcbe6d into TryGhost:main May 29, 2026
42 checks passed
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