You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CP header avatar has no src when the avatar asset is in a private container #15605
When a user's avatar field points to an asset in a private asset container, the avatar in the CP header renders as an <img> with no src attribute, so the browser shows a broken image.
The header reads user.avatar.permalink. The user comes from JavascriptComposer::user() as $user->toAugmentedCollection(), so avatar is the augmented asset, and AssetContainer::url() returns null for a private container. The permalink is therefore null.
$user->avatar() already handles this case. It returns the CP thumbnail URL (/cp/thumbnails/{id}/small/square), which works for private assets. It's also what ListedUser uses, so avatars in the Users listing are fine. Only the header (and anywhere else reading avatar.permalink) breaks.
Expected: the header shows the avatar using the same URL $user->avatar() returns.
How to reproduce
Create an asset container on a disk with 'visibility' => 'private' and no url (a private S3 bucket, or a local disk outside public/).
In the user blueprint, point the avatar assets field at that container.
Upload an avatar for your user and save.
Reload the CP. The avatar in the top-right header is broken, and its <img> has no src.
Reproduced on 6.31.0. The relevant code is unchanged in 6.35.1 (JavascriptComposer::user() and AssetContainer::url()). A fix might be to merge 'avatar' => $user->avatar() (or a dedicated avatar_url) into the array JavascriptComposer::user() returns, and have the header read that instead of avatar.permalink.
changed the title [-][6.x] CP header avatar has no src when the avatar asset is in a private container[/-][+]CP header avatar has no src when the avatar asset is in a private container[/+]on Oct 7, 2026
Activity
[-][6.x] CP header avatar has no src when the avatar asset is in a private container[/-][+]CP header avatar has no src when the avatar asset is in a private container[/+]