Problem/Motivation

Hi guys,
I found a bug when we enable Content Moderation and content translation modules.
I tried to create a content and translate it in different languages in publish state first.
After adding some translations in different languages via the translation form of Drupal, I decided to add a new draft version to one of my translation.
When I add a new published translation, some of my previous translation disappeared in the node translation dashboard (node/{nid}/translation). In the database, I can see all my previous revisions but not in the UI.

Steps to reproduce:

  1. Create a publish content in EN (for example)
  2. Translate this content in DE language and publish it.
  3. Translate this content in IT language and publish it.
  4. Create a new draft version for IT version
  5. Add a new ES translation

Proposed resolution

The entity load in the ContentTranslationController is not the right one. Instead of using `getLatestTranslationAffectedRevisionId` to get the correct revision, use the `getActive` method from the Entity Repository.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

JnLuC21 created an issue. See original summary.

JnLuC21’s picture

JnLuC21’s picture

Issue summary: View changes
JnLuC21’s picture

Issue summary: View changes
JnLuC21’s picture

StatusFileSize
new4.16 KB
JnLuC21’s picture

Issue summary: View changes
StatusFileSize
new4.16 KB
Heisen-blue’s picture

Issue summary: View changes
Status: Active » Needs review
supriyagupta’s picture

I have tried this with Drupal version 9.2.x . I have installed workflow module and configure translation module but nothing is working fine on node form workflow state not displayed.

JnLuC21’s picture

Hi @supriyagupta,
My patch is only functional in Drupal 8.9.
I will post an patch for Drupal9 ASAP.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
rajandro’s picture

Status: Needs review » Needs work
Issue tags: +content moderation multilingual bug
Related issues: +#3069674: Translated node disappears (from backend UI and public site)

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

johnrosswvsu’s picture

Adding a patch applicable for 9.5.x.

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new3.85 KB
new968 bytes

Added missing parameter comment. Attached interdiff for same. please review

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests, +Needs Review Queue Initiative

Wonder if this could be related at all #2806009: Installing a module causes translations to be overwritten

If separate this will need tests to show the issue.

_pratik_’s picture

Status: Needs work » Needs review
StatusFileSize
new4.83 KB
new1.71 KB
smustgrave’s picture

Status: Needs review » Needs work

Still needs an answer for #17. Not ready for review.

dabblela’s picture

Status: Needs work » Needs review

It looks like this is the same issue as #3329066: Creating a new translation may delete translations with drafts. That issue also has a patch with tests, but a different fix. I'm not really sure what the best approach is, I think the patch there is a little closer to how translation currently works.

I don't believe #2806009: Installing a module causes translations to be overwritten is related, that looks more like interface translation than content translation.

smustgrave’s picture

Status: Needs review » Closed (duplicate)

Will agree this does appear to be a duplicate. Other one seems further along and already has test coverage.