Problem/Motivation
Steps to reproduce from #3117751: Unpublished revisions of multilingual node rollback unpublished revision of another language to default revision:
Let's have a multilingual site & node with more than 1 language (i.e. node is translatable): EN & DE.
Also enable Workflows module to have draft & published states.We have 2 published revisions for EN & DE languages.
Then we create new revision of node with EN language but do not publish. Database containt up-to-date value for e.g. field body.
After it we create new draft revision of DE node.
Database contains value for body field for EN node from previous published (default) revision.
Drafts with different languages of one node should not revert another draft to previous state.
It also affects JSON:API.
There are a lot of possible related issues I guess:
#2875861: Optimize updating data and revision data tables
#3023194: [PP-2] Add parallel revisioning support
#2795279: [PP-2] [META] Revisions support
#2833084: $entity->original doesn't adequately address intentions when saving a revision
#2833049: ContentEntityBase::hasTranslationChanges will compare a forward revision with the default one instead of the newest forward revision
#2477419: Codify mechanism to set a forward revision as the default revision
#2960887: Do not create field revisions when field data hasn't changed
#2769741: Node revisions page might not list a default revision
#3056440: Cannot add new translation if the latest affected translation revision of the source language is older than the default revision
#3080995: EntityRepository::getActive does not return a translations most recent revision
#2815949: It is not possible to know if a revision was once the default
#2766957-176: Forward revisions + translation UI can result in forked draft revisions - potential root cause
#2845144: Users without 'bypass node access' permission can't reference unpublished content even if they have access to it
#3412626: Difference between the 'Paragraphs (stable)' widget and the 'Paragraphs Legacy Asymmetric' widgetHow to reproduce
- 1. Add 2 languages to site (EN and any one).
- 2. Make "Article" node revisionable & translatable.
- 3. Create Moderation Workflow with: draft, review, published states.
- 4. Create Published revision of node with default language: body field text = "published default"
- 5. Create Draft revision of node with default language: body field text = "draft default"
- 6. Verify database table "node_revision__body", created node has body_value = "draft default" for default (en) language
- 7. Create Published revision of node with non-default language: body field text = "published translation"
- 8. Create Draft revision of node with non-default language: body field text = "draft default"
- 9. Verify database table "node_revision__body", created node has body_value = "published default for default (en) language
Visually database will look like:
Revision 9659 contains new EN content but reverts RU to previous published.
Revision 9660 contains new RU content but reverts EN to previous published.
Revision 9661 contains new EN content but reverts RU to previous published once again.
Original report: I am using Content moderation, Workflows, Language and Content translation core modules in Drupal 8.6.4. I have implemented workflow on Basic page with states like (Draft, Audit, Review, Pre Publish and Publish). Now I am creating a Test content in English as well as in Spanish language and pass all the workflow states and publish the content in both language. Now when i try to update the moderation state of both of these content to Draft one of them gets auto published, but inside the edit mode it shows current state as Draft only for both of the content which is correct. (Here, we are refering to content_moderation_state_revision table in DB)
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | Screen Shot 2023-07-17 at 2.08.38 PM.png | 14.59 KB | mdranove |

Comments
Comment #2
Nitish k commentedComment #3
dmitry.korhovComment #4
dmitry.korhovComment #5
sam152 commentedComment #6
sam152 commentedComment #7
catchMarking #3117751: Unpublished revisions of multilingual node rollback unpublished revision of another language to default revision as duplicate.
Comment #8
catchComment #9
catchComment #10
catchComment #11
catchComment #12
catchComment #13
ion.macaria commentedI can confirm, if you will try to change moderation state which affect node status for original language content, will be made one new revision for every entity translated language.
Comment #14
catchLinking #3095414: Add the concept of workspace providers which is probably the long term way to fix this and all the similar issues in the core queue.
Comment #15
bahuma20This is a duplicate of #3020387: Moderation state is the same for all node's translations in edit page
Comment #16
rafaelrs commentedHey everyone,
Any updates on this issue? We're facing the same problem here as well.
Comment #17
dmitry.korhov@rafaelrs, what version of Drupal do you use?
Comment #18
ejanus commentedI am facing this EXACT same issue. Are we sure this is not independent of the supposed related issue?
Drupal core: 9.4.8
Comment #19
deepakrmklm commentedI am facing same issue but randomly. Published contents of the 'default language' is being reverted when non-default language is being published.
Drupal core: 9.2.21
Core features: Workflows, Multilingual
Contributed: Paragraphs
This issue should not be closed mapping to a Fixed issue.
Comment #20
deepakrmklm commentedComment #21
emanaton commentedOf possible interest, we solved this issue on our suite of sites by applying the patch found at: https://www.drupal.org/project/drupal/issues/2845144#comment-14574850
Comment #22
mdranove commentedRegarding #19
We are also experiencing an issue, I believe it is what you are referring to. This is obvious on our site as there is a contextual filter set to create anchor links to paragraphs on each node. Occasionally a content manager will try to recover their work from an unpublished revision after the translation has been published by clicking "revert" on the revision they want. This borks the view, as the latest revision is becomes unpublished, and the view does not display unpublished content.
Steps to reproduce
All in all, this makes multilingual workflow very cumbersome and hard to follow when you are fielding multiple edits to a translatable node at the same time in different languages and have no way of knowing what the client will want published first.
Comment #23
dwwThere's no code started here, so this is more accurately "active" not "needs work". All issues should target version 11.x for now, and will be backported to the right branch(es) as needed by the core committers.
Sounds like this is still an issue, although based on #21 this might be duplicate with #2845144: Users without 'bypass node access' permission can't reference unpublished content even if they have access to it? Adding to the pile of related issues.
Regardless, tagging to be smashed...
Comment #24
pameeela commentedWe are a bit puzzled by the suggestion that this is a duplicate of #2845144: Users without 'bypass node access' permission can't reference unpublished content even if they have access to it as it does not seem related at all. Just in case, we tried the patch from there and it did not resolve our issue.
Comment #25
mdranove commentedYes I do think this is a critical issue, still active. Last and current project still have same exact problem.
I wanted to post again to try to be more succint and to describe it from the content manager's perspective.
Assume you have two languages, EN and ES, you have workflows, moderation states, translatable entities, etc:
1. Save a draft of a node in EN.
2. Save a draft of the same node in ES.
3. Publish the ES draft.
4. Content manager no longer has access to edit the EN draft in step 1, because it is no longer the "latest revision". They can still see this draft in the revision history but it's not editable. They essentially lose all their work.
Hope this helps.
Comment #26
pameeela commented@mdranove I see, thanks, that does sound like it relates to #2845144: Users without 'bypass node access' permission can't reference unpublished content even if they have access to it but I think that's not the same as the issue here.
Our issue is simply with the publish status of translations being updated. If you have a node with two translations, updating the publish status of one translation has unexpected effects on the other.
There are a few ways that this plays out, depending on whether publish status is translatable, but it doesn't relate at all to editors being able to access the content or not.
Comment #27
vinay_ankireddipalli commentedI am also facing this issue with D 10.2.4. Can anyone help us to fix this problem.
Steps to reproduce the issue:
1. Multi-lingual site with Custom Languages , enabled Workflows module to have draft, published & Unpublished states.
2. Create English content as published.
3. Translated English content to Portuguese and Published.
4. Trasnlated English content to French and Published.
5. Made some changes to Portuguese content saved as Draft.
6. Made some changes to French content saved as Draft. Portuguese Draft content changes are not showing now, showing published content.
Comment #28
charginghawk commentedIf anybody else is banging their head against this issue, here was my quick fix, assuming that you only want unidirectional updates from English to other languages:
Comment #29
pratikshad commentedHey All,
Is there any patch available to fix this, because we are facing the same problem here as well?
Comment #30
idflood commentedA client reported this issue on a production website. It was certainly working "before", but i don't know which update triggered this.
One thing, it happens for me even as admin, so at least for my case it's not related to the user without "bypass node access" related issue.
edit: maybe related to paragraphs (and Paragraphs Asymmetric Translation Widget). I wasn't able to reproduce the issue when saving drafts in one page in both languages (fr and de). But as soon as I added a paragraph to the german draft it "pubilshed" a new revision of the previously published french page.
Comment #31
idflood commentedIt seems that the "root" cause may come from any module which "wrongly" affect translation data on save.
I've added #3412626: Difference between the 'Paragraphs (stable)' widget and the 'Paragraphs Legacy Asymmetric' widget as related, since after switching my paragraphs fields to the Paragraphs Legacy Asymmetric widget, I can't reproduce the issue on new page/content.
Comment #32
rob230 commentedI think I'm having this problem - although I'm not sure whether it's a bug with Drupal core revisions, translations, content moderation or paragraphs.
It's a major issue because it is causing draft unfinished content to be unexpectedly published when somebody edits a published translation.
Steps to reproduce:
Is this the same issue reported here, or should I make a new issue?
I don't think it's anything to do with paragraphs widgets as the previous post implies, because it happens even if you just edit the title and don't edit/expand any paragraphs.
The problem appears to be that whenever you edit any translation, Drupal will create new revisions for all translations, containing the same as what was in the previous revision. That's not a problem most of the time, unless you have a published page with a new unpublished draft. I am not sure of the reason for why it has been designed this way, it results in a lot of duplicate data in the database but I'm sure there is a reason for it.
Comment #33
mageshbcet1 commentedHello,
We are also facing the same issue in our site. We are using Content Moderation, Workflows, Multilingual, Paragraphs, Paragraph Library, and Inline Entity Form modules.
Steps to reproduce:
Any help would be appreciated!
Comment #34
aaron.ferris commentedI've also come across what I think is the same problem, I see this problem when I get several drafts deep.
To showcase this from field values, I have a rich text paragraph that is nested in another paragraph, on a content type with 2 languages.
This results in viewing "English V3" when viewing the published English node, when that field value doesn't exist in a published revision.
Comment #35
mageshbcet1 commentedAny patch available to fix this issue?
Comment #36
joel_osc commentedI have a client that is seeing what looks like this issue on several sites. Intermittently what happens is that they start working on a node with En and Fr versions published. Then they edit the En and save it as draft, edit the Fr and save it as published. Go back to the En and find their changes are gone and need to revert them from a previous revision.
When the En draft content is lost, the revision that was created for the Fr seems to be marked revisionTranslationAffected in both En and Fr as shown below and the same vid shows on both the En and Fr revisions page - which I believe should never happen.
langcode status uid title created changed promote sticky default_langcode revision_translation_affected
en 1 1 TitleEn. 1520349494 1765834935 0 0 1 1
fr 1 1 TitleFr 1730222353 1765834935 0 0 0 1
I have a copy of their site with a node that does this 100% of the time. I tried the workaround in #28 and it worked - saving the Fr no longer wipes out the En draft. Not quite time to celebrate though - when I edit the En node now it won't save because its changed date is behind which triggers the EntityChangedConstraintValidator constraint and prevents the node form from being saved with the message, "The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved. " so I don't think the workaround is viable, but maybe it can give some insight on what is happening.
Comment #37
joel_osc commentedI have found a few instances where this will occur:
1. Adding a boolean field to a content type with existing nodes:
(a) create a new content type, set it to be moderated and translated
(b) add a node and publish the En
(c) translate the node and publish it
(d) create a draft of the node in En
(c) add a boolean field to your content type and DO NOT set it to translatable
(d) edit the translation and save it as published
Result: The draft En version will be superseded by the new translation revision which does not have the En draft changes.
I believe what is happening is that FieldItemList::hasAffectingChanges will do a count on the En and the translation items - the translation will return 1 and the original will return 0 so hasAffectedChanges returns TRUE, which will then incorrectly set the RevisionTranslationAffected on the En.
2. Adding the search_api_exclude module (my case) and enabling it on existing content - which adds a boolean field to the content-type thirdparty settings.
a) create a new content type, set it to be moderated and translated
(b) add a node and publish the En
(c) translate the node and publish it
(d) create a draft of the node in En
(e) enable search_api_exclude module
(f) enable search_api_exclude on your content type
(g) edit the translation and save it as published
Result: The draft En version will be superseded by the new translation revision which does not have the En draft changes.
I am not sure what other fields are susceptible to this issue, I testing with a plain text field that the issue does not occur. Also, if others find that what I am seeing is not the issue being reported here I will open a new ticket, if it is even a bug. I am not sure I have a workaround since modules like views_bulk_edit have problems updating moderated, translated content #3559935: Incorrect revision used to update moderated, translated content causes drafts to be published.