Problem/Motivation

Steps to reproduce:

  1. Create an English entity
  2. Create an Italian translation in a new default revision
  3. Create a new English pending revision
  4. Remove the Italian translation in a new default revision
  5. Create a new English default revision starting from the previous pending one

Expected result: only the English translation is available in the default revision
Actual result: both English and Italian are available in the default revision, as the Italian translation was restored

Proposed resolution

Make sure that, when creating a new revision, only creating a new translation for the active language is allowed, so that only the current translation is affected, as usual.

Remaining tasks

  • Validate the proposed solution
  • Write a patch
  • Reviews

User interface changes

None

API changes

None

Data model changes

None

Comments

plach created an issue. See original summary.

plach’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.11 KB

Here is a test-only patch.

plach’s picture

And here's the fix

plach’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Setting back to RTBC, as this code was already reviewed/approved in #2940890: Don’t allow deleting revision translations in pending revisions.

plach’s picture

Status: Reviewed & tested by the community » Needs review

Actually no, I slightly tweaked tests to match the STR more closely. Nbd, but needs review...

Interdiff coming soon

plach’s picture

plach’s picture

Version: 8.5.x-dev » 8.6.x-dev
Assigned: plach » Unassigned
berdir’s picture

Hm, what if you *do* want to restore a deleted translation? I'm not up to do date with all revision/translation changes, but shouldn't we still allow that if you want to?

plach’s picture

You don't do that as part of creating a new revision for another translation :)

plach’s picture

I mean, if you wish to add back the Italian translation you should create a new revision starting from a translation object with Italian as the active language.

berdir’s picture

I guess, yes, just asking. AFAIK, the problem is that you actually can't get a revision list of that translation anymore ;)

plach’s picture

Well, that introduces a new discussion around what a removed translation and how the UI should treat it in the pending revision world. Probably to be discussed in #2945956: Allow removing translations in pending revisions.

timmillwood’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine to me.

It might be nice to see a test only patch.

plach’s picture

@timmillwood

Thanks!

The test-only patch is the one in #2, the interdiff was referring to the parent issue, no code changes in tests between #2 and #3.

timmillwood’s picture

ah ha, sorry for the confusion, thanks for the clarification.

plach’s picture

@catch suggested a comment improvement in Slack

  • catch committed 787ca24 on 8.6.x
    Issue #2949619 by plach: Removed revision translations may reappear when...

  • catch committed 29b0fb6 on 8.5.x
    Issue #2949619 by plach: Removed revision translations may reappear when...
catch’s picture

Version: 8.6.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.