Impossible to delete published translations on unpublished nodes

Created on 16 October 2018, about 6 years ago
Updated 19 April 2024, 8 months ago

I have a multilingual site that uses content_moderation workflow and revisions. I came across an issue recently where If I create a node and leave it in review but then translate it, and publish the translation, I cannot delete the translation.

Steps to reproduce:

  1. Create a site with three languages and enable content moderation
  2. Create an article in the default language but do not publish it.
  3. Create a translation of new article and publish it
  4. Create a second translation of the article and publish it
  5. Now try to delete the translations. They appear to delete but when you visit the translations page you will still see them marked as published. If you try to visit the translated pages you will get a 500 error as they entity has deleted the translation but the tables have not been updated. If you have created a single translation you will be able to delete the translation by clicking delete a second time. However if you have multiple publish translations on an unpublished node you will not be able to delete the translations

From what I can see, it all comes down to the entity after the translation is deleted is not being marked as a default_revision because it does not trigger any of the following in 'src/EntityOperations.php':

$update_default_revision = $entity->isNew()
      || $current_state->isDefaultRevisionState()
      || !$this->moderationInfo->isDefaultRevisionPublished($entity);

If I force $update_default_revision to be true the node deletes translations correctly. Is it correct to have a new default revision on every translation removal?

Expected Behavior

When I delete a translation I expect it to be removed from the list of available translations and to be redirected back to the default language translation which should be unpublished.

Actual Behavior

When I delete a translation I get redirected to a seemingly published version of unpublished default language article and translation still appears as published in translation list even though it has been removed from the entity.

Remaining tasks

Write tests
Code review

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Content moderationΒ  β†’

Last updated 20 days ago

  • Maintained by
  • πŸ‡¦πŸ‡ΊAustralia @Sam152
Created by

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