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 a path alias for the translated node gets created in the live workspace, not in the active workspace
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
Issue fork drupal-3518220
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3518220-translations-created-in
changes, plain diff MR !11779
Comments
Comment #2
alecsmrekar commentedComment #4
alecsmrekar commentedComment #5
smustgrave commentedWill need test coverage as a next step. Thanks!
Comment #6
plachThis is working well in our project, we "just" need to add test coverage now :)
Comment #7
alecsmrekar commentedComment #8
plachTest looks good!
Comment #9
amateescu commentedPosted a few comments on the MR.
Comment #10
alecsmrekar commentedComment #11
amateescu commentedLooks great now!
Comment #12
catchOne comment on the MR.
Comment #13
alecsmrekar commentedComment #14
plachThanks!
Comment #15
catchCommitted/pushed to 11.x, thanks!
Comment #18
catchComment #20
pameeela commented