I am trying to understand how language selector on content are supposed to work when creating new revision. for example,
suppose I have a published article in english, then I edit the article and check the create a new revision checkbox and I choose german from the language selector on node form and click save.
After this I end up with a published node in english, and a draft node in german. Is the draft node supposed to be considered a pending translation?
because If I go to the translation tab, I see the draft as an unpublished translation but if I delete from the translation tab, the entire node is deleted along with the published node.

I feel there is a gap in my understanding on how this should work. any help is appreciated.

Adding steps to reproduce:
- Enable content_translation & content moderation
- Make english as default language and add another i.e. german.
- Enable editorial workflow for content (i.e. article & Basic page)
- from 'admin/config/regional/content-language' ensure that content type have the 'Show language selector on create and edit pages' enabled.
- create and publish an article and ensure the selected language for the node edit is english.
- Edit the node again and change the language to German and save as a draft.

Actual behavior For Article content type :

- Exception is thrown.

Actual behavior For Basic Page content type :

- Access denied upon saving.
- But a revision in the selected language is created and treated as a draft translation.
- Deleting the created revision, deletes the entire node including the published including node.

Excepted Behavior

That's what I want to understand.

I created a patch that logs the exception instead of throwing it but it does not address the core issue: https://www.drupal.org/project/drupal/issues/2995655 but I am not certain how changing the language on an entity revision should work.

Comments

awm created an issue. See original summary.

sleitner’s picture

awm, I can't reproduce your problem. Please provide all steps from installation, eg. using simplytest.me , and all activated modules.

I assume that you should use the translate button to add a translation (do not change the language in edit mode). Maybe this is a workflow/content moderation issue.

Following your steps, I ended up with no english version (status: not translated) and loosing all english revisions (they are still in the database, but not visible). The node of the second language is published.

(Drupal 8.6.2 and 8.7.x standard installation; additional core modules activated: content translation, workflow, content moderation; activated content translation for basic page; activated "editorial" workflow for basic page)

awm’s picture

Issue summary: View changes
awm’s picture

@sleitner I added steps to reproduce and more info. please take a look and let me know.

awm’s picture

Issue summary: View changes
awm’s picture

Issue summary: View changes
awm’s picture

Issue summary: View changes
awm’s picture

Issue summary: View changes
sleitner’s picture

@awm you did not mention that you are saving as a draft at the same time. Now I can reproduce this.

I think, the node is (/can be) deleted because the published english version still is handled as the original language, but the translated version is incorrectly marked as original language.

The savest way would be, handling changes of the language like translations. As a plus, revisions of the first language would not get inaccessible, when not changing the publishing status (or without content moderation). Unpublishing/ Draft has to be done manually.

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.

cilefen’s picture

Category: Support request » Bug report

This looks like it was intended to have been a bug report.

awm’s picture

Thanks for the update. Feel free to update the issue title to what makes most sense.

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.

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.

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.

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.