Cannot create entity with image in a workspace

Created on 14 January 2019, almost 6 years ago
Updated 29 May 2024, 6 months ago

Problem/Motivation

File entities can not be saved in a workspace.

The article gets created but the image field is being skipped. Checking the logs gives
"RuntimeException: This entity can only be saved in the default workspace. in Drupal\workspaces\EntityOperations->entityPresave() (line 128 of /home/d0fao/www/core/modules/workspaces/src/EntityOperations.php)."

Which points to file entity not being able to be created in the non-default workspace since the file entity is not revisionable.
I recall reading about some issues why this was not supported. The problem here lies that this also makes it impossible to create (local) image media entities in the non-default workspace.

I was expecting this to be possible, but seems my expectation was incorrect. Am i doing something wrong here in the usage of workspaces. I was expecting it to be possible to create entities with file fields in the stage workspace, and 'publish' them to live when everything was done.

Steps to reproduce

  • Install standard profile
  • Enable workspaces
  • Switch to staging workspace
  • Create article with image attached

Proposed resolution

Use IgnoredWorkspaceHandler for the file entity type.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Allow CRUD operations for files in a workspace.

Data model changes

Nope.

Release notes snippet

Nope.

πŸ› Bug report
Status

Fixed

Version

10.3 ✨

Component
WorkspacesΒ  β†’

Last updated about 6 hours ago

No maintainer
Created by

πŸ‡§πŸ‡ͺBelgium mallezie Loenhout

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024