Problem/Motivation
Users are faced with a warning "The "Delete translation" action is only available for published translations."
that a translation can't be deleted if it doesn't have the published moderation state.
Steps to reproduce
- Install Drupal (standard profile)
- Enable content_translation & content_moderation modules (/admin/modules)
- Add a new language, for example "Dutch" (/admin/config/regional/language/add)
- Enable content translation for "Content"& flag the "Article" content type as translatable (/admin/config/regional/content-language)
- Give the "Authenticated user" role the "Create translations", "Edit translations", "Translate Article content item", "Article: Create new content", "Article: Edit any content", "Editorial workflow: Use Create New Draft transition"& "Editorial workflow: Use Publish transition" permissions (/admin/people/permissions)
- Enable the editorial workflow on the article content type (/admin/config/workflow/workflows/manage/editorial)
- Create a new user, without any specific roles (/admin/people/create)
- Log in with the new user (/user/logout > /user/login)
- Create a new article node with the "Published" state (/node/add/article)
- Add a translation with the "Draft" state (/nl/node/1/translations/add/en/nl)
- Navigate to the "Translations" page of the created node (/node/1/translations)
Current behavior: a warning "The "Delete translation" action is only available for published translations." is displayed
Expected behavior: the warning to not show, since the user isn't allowed to delete translation (he/she is missing the "Delete translations" permission)
Proposed resolution
Before displaying the warning, first check if the user is allowed to delete the translation. If not, don't display the warning.