Translations created in Live workspace

Created on 9 April 2025, about 2 months ago

Problem/Motivation

When a translation is added for an entity, the workspaces module will attach the translation to the default revision, and that operation will run outside of a workspace. That is problematic, because all code that reacts to the event will run its logic in the live workspace. One such example is Drupal\path\Plugin\Field\FieldType::postSave that will create a path alias in the live workspace.

Steps to reproduce

1. On a multilingual site create an unpublished node in the Live workspace
2. Create a new workspace
3. Add a manual path alias to the english/default language of the node, and publish the node
4. Add a translation for the node (language of your choice)
5. Notice that two path aliases (instead of one) get created in the selected language

Proposed resolution

Instead of attaching the translation to the main revision in the live WS, do it in the current WS.

Remaining tasks

Post a MR

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component

workspaces.module

Created by

🇸🇮Slovenia alecsmrekar

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024