Warning "The Delete translation action is only available for published translations" is displayed also for users without the delete translatons permission

Created on 7 October 2020, over 4 years ago
Updated 28 November 2023, about 1 year ago

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

  1. Install Drupal (standard profile)
  2. Enable content_translation & content_moderation modules (/admin/modules)
  3. Add a new language, for example "Dutch" (/admin/config/regional/language/add)
  4. Enable content translation for "Content" & flag the "Article" content type as translatable (/admin/config/regional/content-language)
  5. 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)
  6. Enable the editorial workflow on the article content type (/admin/config/workflow/workflows/manage/editorial)
  7. Create a new user, without any specific roles (/admin/people/create)
  8. Log in with the new user (/user/logout > /user/login)
  9. Create a new article node with the "Published" state (/node/add/article)
  10. Add a translation with the "Draft" state (/nl/node/1/translations/add/en/nl)
  11. 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.

🐛 Bug report
Status

Needs work

Version

9.5

Component
Content translation 

Last updated about 14 hours ago

No maintainer
Created by

🇧🇪Belgium rp7

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024