Cannot add new translation if the latest affected translation revision of the source language is older than the default revision

Created on 22 May 2019, over 5 years ago
Updated 4 September 2024, 4 days ago

Problem/Motivation

The content translation controller add translation page looks to see if the latest revision of an entity is a pending revision, and if it is, loads the latest affected translation revision of the source language, to populate the content entity form. When this happens, the latest affected translation revision can be older than the default revision. This causes the entity changed constraint to fail because it compares all the timestamps of the translations of the (older) source LAT revision to the (newer) default revision and fails.

Proposed resolution

I *think* the controller should load the default revision if the source language LAT revision is older than the default revision, but I'm not sure if this will cause other problems.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Content translationΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States mikelutz Michigan, USA

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.

  • The Needs Review Queue Bot β†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

  • Status changed to Needs review 11 days ago
  • πŸ‡³πŸ‡±Netherlands seanB Netherlands

    I just ran into the same issue working with translations and content moderation. Specifically when:

    1. The user adds a translation (from EN to NL for example).
    2. The user publishes both EN and NL.
    3. The user then removes the NL translation.
    4. More revisions are made for EN (these revisions no longer have a copy of the NL translation since it has been removed).
    5. The the user visits the translation overview, somehow it seems the NL translation still exists, so the user can't create a new translation, and is also not able to delete the NL translation.

    When I tried the latest patch I still found two issues:

    • The translation overview uses the latest translation affected revision. Which made it seem like the NL translation could not be removed (since the NL langcode had an older translation affected revision). We should probably also check here if the latest translation affected revision is newer than the default.
    • The entity repository EntityRepository::getActive() also loads the latest translation affected revision. This prevented creating a new translation from the default revision.

    An updated patch is attached.

  • πŸ‡³πŸ‡±Netherlands seanB Netherlands

    If the default revision still contains the translation, we can still allow older revisions to be loaded.

  • Merge request !9345Resolve #3056440 "Cannot add new" β†’ (Open) created by seanB
  • Pipeline finished with Failed
    11 days ago
    Total: 151s
    #266572
  • Pipeline finished with Failed
    11 days ago
    Total: 259s
    #266579
  • Pipeline finished with Failed
    11 days ago
    Total: 695s
    #266580
  • Status changed to Needs work 4 days ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Appears to have some test failures

Production build 0.71.5 2024