EntityPrintController loads untranslated entity

Created on 15 March 2019, over 5 years ago
Updated 16 April 2024, 7 months ago

EntityPrintController loads untranslated entity that leads to further treating of entity as if it was in default language. For example, file name will be generated using the default language instead of the current one.

🐛 Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

🇺🇦Ukraine solariel

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.

  • 🇧🇪Belgium swentel

    The translated entity should probably be loaded in the checkAccess method too, although it's really an edge case we've experienced in combination with the Content Language Access module ( https://www.drupal.org/project/content_language_access ).

    If the original entity is passed, the language of that entity might not be equal to the current content language.

    Again, very edge case, but good to know if other people run into that, although it's probably related with #2976381: Downloaded PDFs for translation display data in original language too.

  • First commit to issue fork.
  • 🇮🇳India shalini_jha

    I have faced one more issue with the translated node View PDF link is also showing access denied for the translated node.

  • 🇮🇳India shalini_jha

    I have tested Patch #2, and the file name generation is based on the current language. As mentioned in #4, these translated nodes need to load in the checkAccess method as well. I encountered an issue with the download PDF link; it was showing "access denied" for translated nodes because the current code was checking in the default language, thus causing permission denied errors. To resolve this, I have added the same logic to the checkAccess method and tested it, confirming that it now works for translated nodes.

    I have updated the Patch #2.

  • Status changed to RTBC about 17 hours ago
  • 🇹🇼Taiwan joey91133

    #7 patch is work on defalut language node not translated.

Production build 0.71.5 2024