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
Comment #2
sleitner commentedawm, 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)
Comment #3
awm commentedComment #4
awm commented@sleitner I added steps to reproduce and more info. please take a look and let me know.
Comment #5
awm commentedComment #6
awm commentedComment #7
awm commentedComment #8
awm commentedComment #9
sleitner commented@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.
Comment #10
sleitner commentedComment #17
cilefen commentedThis looks like it was intended to have been a bug report.
Comment #18
awm commentedThanks for the update. Feel free to update the issue title to what makes most sense.