🐛 Fixed @site.admin_url missing /ghost/ when admin URL is configured#26960
🐛 Fixed @site.admin_url missing /ghost/ when admin URL is configured#26960
Conversation
getAdminUrl() returns the base admin domain without /ghost/, so using
it directly for @site.admin_url produced links to the domain root
instead of the admin panel. Use urlFor("admin", true) which correctly
appends /ghost/ to the admin URL.
Added test that stubs getAdminUrl() with a separate domain to verify
admin_url always ends with /ghost/.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe admin URL construction in the theme engine middleware was modified to consistently use 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Problem
@site.admin_urlwas usinggetAdminUrl()which returns the base admin domain (e.g.https://admin.example.com/) without/ghost/. This means the "Site owner login" link on the private page pointed to the domain root instead of the admin panel for any site with a separate admin URL configured (including all Ghost(Pro) sites).Fix
Changed
update-local-template-options.jsto useurlFor('admin', true)which correctly appends/ghost/to the admin URL.Test
Added a test that stubs
getAdminUrl()with a separate domain (https://admin.example.com/) and asserts the resultingadmin_urlends with/ghost/. This test fails on main and passes with the fix.