Summary
On Statamic 6, opening any asset editor throws and the editor's fields never render:
Uncaught (in promise) TypeError: can't access property "replaceAll", this.container.site.value is undefined
Cause
resources/js/Workspace.js builds the presence channel from the container's site:
this.channelName = `${reference}.${this.container.site.value.replaceAll('.', '_')}`;
Assets are not site-scoped, so the asset publish-container has no site → container.site.value is undefined → it throws during workspace init (the component's mounted hook), aborting the editor render.
resources/js/collaboration.js guards reference but not site:
Statamic.$events.$on('publish-container-created', container => {
if (!container.reference.value) return; // no site guard
manager.addWorkspace(container);
});
The same unguarded access is also in initializeContainerWatcher().
Steps to reproduce
- Statamic 6 +
statamic/collaboration 2.0.1, a single-site install.
- Open any asset editor:
/cp/assets/browse/{container}/{path}/edit.
- The editor's fields don't render; the console shows the TypeError above.
Confirmed on multiple containers (a local disk container and a custom-disk container), so it's not container-specific — it affects all asset editing.
Suggested fix
Skip the workspace when there's no site (collaboration on assets isn't meaningful — the channel name requires one), e.g. in the publish-container-created handler:
if (!container.reference.value || !container.site?.value) return;
or guard/default container.site.value in Workspace.initializeEcho() (and the watcher).
Environment
statamic/cms 6.20.1
statamic/collaboration 2.0.1
- Single-site install
Summary
On Statamic 6, opening any asset editor throws and the editor's fields never render:
Cause
resources/js/Workspace.jsbuilds the presence channel from the container's site:Assets are not site-scoped, so the asset publish-container has no
site→container.site.valueisundefined→ it throws during workspace init (the component's mounted hook), aborting the editor render.resources/js/collaboration.jsguardsreferencebut notsite:The same unguarded access is also in
initializeContainerWatcher().Steps to reproduce
statamic/collaboration2.0.1, a single-site install./cp/assets/browse/{container}/{path}/edit.Confirmed on multiple containers (a local disk container and a custom-disk container), so it's not container-specific — it affects all asset editing.
Suggested fix
Skip the workspace when there's no site (collaboration on assets isn't meaningful — the channel name requires one), e.g. in the
publish-container-createdhandler:or guard/default
container.site.valueinWorkspace.initializeEcho()(and the watcher).Environment
statamic/cms6.20.1statamic/collaboration2.0.1