craftcms / craftcms/cms

[5.x]: Multisite: Backend editor/media links stick to login site after top-bar switch (confusing UX)

Open
#18,698 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

On a Craft multisite installation (5.x), switching sites from the top admin bar correctly resolves the frontend preview/context for the selected site. However, the backend editor (entry editors, asset modals, etc.) and media-related links still appear to use the originally logged-in site's context/base URL.

Steps to reproduce
  1. Log into the control panel via Site A’s domain (e.g., sitea.example.com/admin).
  2. Switch to Site B using the site switcher in the top admin bar.
  3. Open an entry editor or asset field for Site B content.
  4. Observe media/asset links and editor preview URLs — they point to Site A’s domain/context.
  5. Frontend preview resolves correctly to Site B.
Expected behavior

Editor links/assets should immediately reflect the switched site's context, matching frontend behavior.

Actual behavior

Backend stays tied to the login site's context. Frontend correctly uses the active site's Base URL.

Why it's confusing:
Authors expect a seamless switch — previewing/editing Site B content should fully use Site B’s URLs everywhere. This creates cognitive dissonance when backend links don't match what authors see on frontend.

Craft CMS version

5.9.14

PHP version

8.2.3

Operating system and version

Linux 6.17.0-1010-azure

Database type and version

8.2.30

Image driver and version

GD 8.2.30

Installed plugins and versions

Contact Form | 3.1.0
Contact Form Honeypot | 2.1.0
Control Panel CSS | 3.0.0
Feed Me | 6.11.0
Field Manager | 4.0.3
Google Maps | 5.2.0
Linkit | 5.0.0
Navigation | 3.0.17
Position Fieldtype | 5.0.0
reCAPTCHA | 3.0.0
Redactor | 4.2
SEO | 5.1.20
Super Table | 4.0.5
Table Maker | 5.0.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the control panel: switch from Site A to Site B, then open an entry editor or asset field and compare its links with the frontend preview URL. Done means editor, asset, and media-related links consistently use the active site's context and base URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.