Problem/Motivation
I am observing the following behavior when content editing and viewing the latest version of translated moderated content. Users with identical permissions, with the exception of "Translate Entity Type" permissions, will observe different latest versions of moderation translation content.
Note: Entity Type in 'Translate Entity Type' refers to the bundle, e.g. Translate Article, Translate Basic Page.
Steps to Reproduce
Consider the following steps to reproduce:
On a standard install, Drupal 8.8.2, Apache/2.4.18, PHP 7.2.23 with content moderation 8.8.2, content translation 8.8.2, workflows 8.8.2, and paragraphs demo 8.x-1.8 enabled, CREATE a new instance of a node in default language (EN) and publish immediately. Translate this node and save translations both in DRAFT state.
- Navigate to the node revisions tab.
- Observe the only revision is the Published English Node (Current Revision)
- Edit one of the draft translations and save as draft
- Navigate to the node revisions tab. Expect to see the translated draft revision in the list. Observe only the Published English Node (Current Revision) revision
- Edit the original published node and save as a draft revision.
- Navigate to the node revisions tab. Expect to see the draft revision in the list. Observe the new draft revision is first and the Published English Node (Current Revision) revision is second.
- Edit one of the draft translations again and safe as draft, again.
- Navigate to the node revisions tab. Expect to see the translated draft revision in the list. Observe only the english draft revision and the Published English Node (Current Revision) revision
As a authenticated user WITH‘View any unpublished content’, ‘View the latest version’, ‘Entity Type : View revisions’, ‘View all revisions’ AND WITHOUT: "Translate Entity Type" permission
- Prior to creating a draft revision of the English published node
- Navigating to the latest version of a draft translation, observe 403
- After creating a draft revision of the English published node
- Navigating to the latest version of. A draft translation, the English latest version (draft) content was displayed
As an administrator (WITH"Translate Entity Type" permission)
- Prior to creating a draft revision of the English published node
- Navigating to the latest version of a draft translation, observed latest draft translation
- After creating a draft revision of the English published node
- Navigating to the latest version of a draft translation, observed latest draft translation.
As an authenticated user (WITH"Translate Entity Type" permission)
- Prior to creating a draft revision of the English published node
- Navigating to the latest version of a draft translation, observed latest draft translation
- After creating a draft revision of the English published node
- Navigating to the latest version of a draft translation, observed latest draft translation.
Alternatively, CREATE a new instance of a node in default language (EN) and save as DRAFT, translate this node and save translations both in DRAFT state.
- Observe no ‘Lastest Version’ tab exists
- Edit the English node and save as Published
- Edit a translation and save as draft, again. Observe a Latest Version is created
As a authenticated user WITH‘View any unpublished content’, ‘View the latest version’, "Entity Type : View revisions", ‘View all revisions’ AND WITHOUT: "Translate Entity Type" permission
- Navigating to the latest version of the draft translation, observe English latest revision
As an administrator (WITH"Translate Entity Type" permissions) OR
As an authenticated user (WITH"Translate Entity Type" permissions)
- Navigating to the latest version of the draft translation, latest draft translation.
Attachments Overview
- entityrepository_getActiveMultiple
- As an authenticated user without Translate Entity Type permissions, on line 167 we can see that $langcode is "de", as expected. However the $entity returned shows that the active/default language of the node is the original language. This is unexpected.
- latestRevisionCheck_loadEntity.png
- As an authenticated user without Translate Entity Type permissions, on line 167 we can see that active langcode of the returned $entity on line 92 is set to the default language. This is unexpected.
- content_translation_permissions.png
- Content Translation permissions overview. We can see that Translate Entity Type permissions dont include any additional help text/description of what the permission allows
Proposed resolution
I think there are a couple topics included in this issue that need to be addressed:
- Draft translation revisions aren’t created and logged if the original language content was published upon creation
- Permissions to view translated draft revisions/latest versions aren’t clear
- Should "Translate Entity Type" permissions be required to view latest version of draft translated content? When this permission is granted to an authenticated user, the user cannot actually translate content (assuming they don't have Create permissions). https://www.drupal.org/project/drupal/issues/2972308#comment-12622344 describes the permission as 'Allowing access to the Translation overview page'.
Remaining tasks
- Review steps to reproduce.
- Identify any related core issues.
- Investigate code, refactor, patch
User interface changes
Unknown
API changes
Unknown
Data model changes
Unknown