- πͺπΈ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 2:21am 25 June 2024 - last update
5 months ago 3 pass - last update
5 months ago Patch Failed to Apply - πΉπΌTaiwan amourow
Patch of #3 works for version 2.0.0-alpha-3 on D10.2 as well.