Invalid transition when using revision and i18n

Created on 29 January 2021, over 3 years ago
Updated 5 September 2023, 9 months ago

Problem/Motivation

With translated nodes and revision enabled there are frequent issue with "Invalid transition" validation when changing a node status, even with the main admin account.

Steps to reproduce

Still not sure exactly how to reproduce it with minimal effort but here is a way I reproduced it.
1. enable 2 languages and translation on the page content type
2. create a page as draft in default language
3. translate it in the second language and set it as draft
4. publish the default language page
5. archive the translated version
6. try to publish the translated version.
7. At that point you should get the error "You do not have access to transition from Archived to Published"

Proposed resolution

Use the same logic as the core content_moderation to load the original entity: https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/modules/cont...

The module currently already use the getLoadedRevisionId() to get the $original_entity, one missing thing is that just after it needs to check isDefaultTranslation() and do some magic after that.

Remaining tasks

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland idflood

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

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.69.0 2024