Unable to modify certain paragraph - You are not allowed to edit or remove this Paragraph.

Created on 8 March 2022, over 2 years ago
Updated 7 September 2023, about 1 year ago

Problem/Motivation

Using Drupal 9 with paragraphs. Some paragraphs are editable for the language, some however are not, stating "You are not allowed to edit or remove this Paragraph." - The only workaround here is to set the permissions "Allow to translate all languages"

Certain paragraphs are editable (like certain text boxes, but others, especially nested ones, gives the error. I have even set all permissions (so replicated administrator permissions) and just let the 2 boxes unchecked allowed languages boxes unchecked under permissions and the result is the same.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa mauzilla

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡ͺπŸ‡ΈSpain jjcarrion Spain

    I am experiencing a problem that's related with the content_lock module and content translation:

    • The content_lock module initiates an AJAX request to verify permissions. When the current user lacks the necessary rights to edit the original language, a 403 error arises.
    • Similarly, I faced challenges on the content translation overview page. Even though users could access a specific language, they were unable to edit a node if they didn't have permissions for the original language.

    To provide some context, in my setup, I always maintain the UI in English across all languages. This causes patch #3 not to function correctly for me because it relies on:

    \Drupal::languageManager()->getCurrentLanguage()
    

    and in my case, I'm getting always English because the UI is set to English always.

    I tried out patch #3 (kudos to @peterwcm!) and it almost fixed the issues for me. After diving deeper with some debugging, I removed the access check with the \Drupal::service('allowed_languages.allowed_languages_manager')->hasPermissionForLanguage($current_language, $user) from the .module (in my case the $current_language was always English). This check is already managed within \Drupal\allowed_languages\Access\ContentTranslationAccessCheck. As of now, I haven't come across any permission-related issues, leading me to believe that the extra verification might be redundant.

    However, I'm still contemplating whether this is the optimal spot for the correction. Any guidance or suggestions about a better location for this fix would be greatly appreciated.

    Thank you!

  • Using Acquia Site Studio module, I met the same issue in the Page Builder to edit a node translation with an allowed language.
    This Page Builder load the layout canvas through an Ajax request where the entity is in its original language, returning a 403.

    Instead of delegate the access or trigger specific routes, I load the entity translation according to the current language.

  • Status changed to Needs review 5 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 8
    last update 5 months ago
    3 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 8
    last update 5 months ago
    Patch Failed to Apply
  • πŸ‡¦πŸ‡ΊAustralia peterwcm
  • πŸ‡ΉπŸ‡ΌTaiwan amourow

    Patch of #3 works for version 2.0.0-alpha-3 on D10.2 as well.

Production build 0.71.5 2024