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.
Comments
Comment #2
peterwcm commentedWe have a similar issue that seems to be related to AJAX events (paragraphs, media library browser) in which the entity is still referencing the original language (In some cases, the translation hasn't been cloned/created yet so we can't rely on the translation either). If the current user doesn't have access to the original language, they can't modify some of the AJAX-related fields or fields that haven't been translated.
This patch is a bit hacky but it gets around the permission issue with the media library and translation creation page. I believe there should be a better solution but that might require more restructuring of the module.
Comment #3
jjcarrionI am experiencing a problem that's related with the content_lock module and content translation:
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:
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!
Comment #4
tzatziki commentedUsing 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.
Comment #5
tzatziki commentedComment #6
peterwcm commentedComment #7
amourowPatch of #3 works for version 2.0.0-alpha-3 on D10.2 as well.
Comment #8
artempoka19 commentedI updated patch of #4
Comment #9
artempoka19 commentedComment #11
heddnThxs for all the contributions here. I took the patch in #8 and midly adjusted it to my likes.