Fixed Mixed language in report notification emails

Kirby

Well-known member
Affected version
2.3.0 Beta 1
Steps to reproduce
  1. Create an additional language: Moderator Language
  2. Create a moderator, set its language to Moderator Language and enable option Receive email when content is reported
  3. Translate phrases report_create_body_html, view_this_report, the_following_reason_was_given, reported_content and post_in_thread_x so their text is distinguishable from the default
  4. Create a post
  5. Report that post using a language other than Moderator Language (=Reporter Language)
Expected Result
All non user-generated text in the email is in Moderator Language

Actual Result

Phrase post_in_thread_x is rendered in Reporter Language

Why does this happen?

The email template is rendered in Moderator Language but the report title is taken from the report entity via cached getter getTitle which calls getContentTitle on the handler class - this method then uses phrase post_in_thread_x.

Suggested Fix
Use {{ $report.getTitle() }} instead of {$report.title} to bypass getter cache.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.0 Beta 6).

Change log:
When sending a new report notification, ensure the title is in the moderator's selected language
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom