Problem/Motivation

In #2940890: Don’t allow deleting revision translations in pending revisions we prevented users from deleting translations in pending revisions, otherwise we would not be able to present a sensible UI, given that in the storage a translation removed in a pending revision is indistinguishable from a new translation added in a pending revision. This only a technical limitation, so we should address this issue properly now.

Proposed resolution

TBD

Remaining tasks

  • Propose a valid solution
  • Write a patch
  • Reviews

User interface changes

Translation deletion actions are available also in pending revisions.

API changes

None

Data model changes

TBD

Comments

plach created an issue. See original summary.

plach’s picture

Title: Allow removing translations in pending revisions » [PP-1] Allow removing translations in pending revisions
wim leers’s picture

Title: [PP-1] Allow removing translations in pending revisions » Allow removing translations in pending revisions
Status: Postponed » Active
matsbla’s picture

Issue tags: +GDPR

In #2940890-17: Don’t allow deleting revision translations in pending revisions @platc wrote:

You can delete the draft by going to the revision list page, once you do that, you can delete the translation in a default revision, if you wish to do so.

This is only true if there already exists a published translation. If you create a new translation and save it as a draft directly it is not possible to delete it in the revision tab. Is there a workaround for this? A worst case scenario could be that you're not able to remove personal information or similar provided by a user.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.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.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.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.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now 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.

dan2k3k4’s picture

Did you find a workaround @matsbla ?

seanb’s picture

This seems very much related to #2815779: Deleting a translation leaves behind orphaned revisions. As mentioned there we have 2 options when deleting a translation:

  1. Deleting a translation from all revisions of the language
  2. Deleting a translation creates a new revision without the deleted language

If we implement 2, I don't think the problem still exists. Every delete creates a new revision in which the translation is no longer available, which means we probably don't need ContentTranslationDeleteAccess anymore.

I guess 1 is also a nice feature, but that could also be a contrib solution once we can actually delete content with pending revisions again.

It seems #2815779: Deleting a translation leaves behind orphaned revisions is going in the direction of solution 2. Should we postpone this on that issue?

seanb’s picture

Status: Active » Needs review
StatusFileSize
new9.03 KB

This patch might be a good start.

Status: Needs review » Needs work

The last submitted patch, 15: 2945956-15.patch, failed testing. View results

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now 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.

smustgrave credited sastha.

smustgrave’s picture

smustgrave’s picture

Briefly looking at failure in #15 believe it could use a Url object as drupal.org makes it run in subdirectory which may mess up paths.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

wilfred.waltman’s picture

StatusFileSize
new9.11 KB

A reroll of #15 for Drupal 10.2

anchal_gupta’s picture

StatusFileSize
new200.49 KB

I have tried patch from #22 on 11.x but not applied and not unable to reproduce this issue in my local. please share process to reproduce the issue.
If i am doing something wrong do let me know the steps or explain the issue with more detail so i can replicate it correctly.

anchal_gupta’s picture

I verified the issue, unable to replicate. Below are the steps followed to replicate the issue.
Scenario 1: Enable Content Translation Module.
Step1: Configure the setting for content language settings for content.
Step2: Create node and add some data and save.
Step3: Then create node in other translated language and save without publised the node.
Step4: And Then add some modification on translated node and save.
Step5 Then check the revision not have the pending revision option to deletion action only showing single row with current revision.
Attached screenshot as per the reference (Screenshot 2024-09-25 at 11.59.32 AM.png).

Scenario 2: Enable workflow module.
Step1: Configure the module settings for content.
Step2: Create node and add some data and save.
Step3: Then create node in other translated language and save with draft mode.
Step4: And Then add some modification on translated node with published mode.
Step5: And Then add some modification on translated node with Draft mode.
Step5 Then check the lastest node modification revision have the delete action.
Attached Screenshot as per Reference (Screenshot 2024-09-25 at 12.11.08 PM.png )

Scenario 3: I have tried patch from #22 on 11.x but not applied then I applied the patch manually but not changes has been shown work as same as fallow the on Scenario 2.

If i am doing something wrong do let me know the steps or explain the issue with more detail so i can replicate it correctly.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

wim leers’s picture

Issue tags: +Experience Builder

This will block functionality planned for Canvas in Q3.

herved’s picture

The guard from #2940890: Don’t allow deleting revision translations in pending revisions can be bypassed, and the deleted translation then comes back:

  1. Create an English node with an Italian translation, both published.
  2. Update the English translation in a new default revision.
  3. Save an English draft.
  4. Delete the Italian translation: "has been deleted" is shown, but the default revision still has it.
  5. Publish the English draft: the Italian translation is back.

The latest revision affecting Italian was a default revision, so ContentTranslationDeleteAccess allows the delete.
As it is no longer the default revision, EntityRepository::getLatestTranslationAffectedRevision() loads the latest revision (the English draft) instead. The translation is removed in that pending revision, and createRevision() copies it back from the default revision when the draft is published.