Problem/Motivation
Motivation:
Inconsistent behavior is confusing, and not seeing translation revisions hinders work of editors.
Problem:
Sometimes revisions tab on translated content only shows original source revisions.
This happens when the original source has a published version, before the translation has any published versions.
Proposed resolution
Show translation revisions on translation revisions tab.
Remaining tasks
- Investigation into cause
- Write test(s)
Steps to reproduce
8.8.x core, with no contrib modules
Setup
- enable content translation (depends on language which will get enabled with it) /admin/modules
- enable workflows /admin/modules
- enable content moderation /admin/modules
- add a language (for example: spanish) /admin/config/regional/language
- configure content translation /admin/config/regional/content-language under "Custom language settings" check "Content" and then check the checkbox for Basic Page (leave the default fields checked) and save configuration
- configure workflows /admin/config/workflow/workflows/manage/editorial in the "This workflow applies to" section, next to "Content types", click "Select", check Basic Page, save, save
to see expected behavior
- add draft english content /node/add/page
- notice /node/1 has tabs: View, Edit, Delete, Revisions, Translate
- notice /node/1/revisions has one table row
- edit and keep in draft
- notice /node/1 has tabs: View, Edit, Delete, Revisions, Translate
- notice /node/1/revisions has two table rows
- translate node
- notice /node/1 has tabs: View, Edit, Delete, Revisions, Translate
- notice /node/1/revisions has two table row
- notice /es/node/1/revisions has one table row
to see bug
- add draft english content /node/add/page
- notice /node/1 has tabs: View, Edit, Delete, Revisions, Translate
- notice /node/1/revisions has one table row
- edit and keep in draft
- notice /node/1 has tabs: View, Edit, Delete, Revisions, Translate
- notice /node/1/revisions has two table rows
- publish
- notice /node/1 has tabs: View, Edit, Delete, Revisions, Translate
- notice /node/1/revisions has three table rows
- translate node: *set state to draft* as saving translation, as creating the translation see https://www.drupal.org/files/issues/2019-11-05/creating-translation-in-d...
- notice on save goes to /es/node/2/latest
- notice /es/node/2/latest has the translation
- notice /es/node/2/latest has tabs: View, Edit, Latest version, Revisions, Translate
- notice /es/node/2/revisions *unexpectedly* shows the english three revisions and no spanish revisions
- notice /node/2/revisions (as expected) shows the english three revisions (and no spanish revisions)
- can edit the translation again, now, there are two revisions of the translation, but no way to see them via the Revisions tab
Bit more investigation
we can go back to the first case, and explore the as expected behavior a bit more, where neither is published, and publish the original language node
- edit first node, publish
- edit translation
- notice the revisions for the translation show on the translation revision tab /es/node/1/revisions
- notice the revisions for the original node show on the revisions tab /node/1/revisions
User interface changes
None (?)
API changes
unknown.
(API changes/additions that would affect module, install profile, and theme developers, including examples of before/after code if appropriate.)
Data model changes
unknown.
(Database or configuration data changes that would make stored data on an existing site incompatible with the site's updated codebase, including changes to hook_schema(), configuration schema or keys, or the expected format of stored data, etc.)
Release notes snippet
unknown.
(Major and critical issues should have a snippet that can be pulled into the release notes when a release is created that includes the fix)