Simple Machines Community Forum

SMF Development => Bug Reports => Topic started by: m4z on February 18, 2020, 03:35:16 PM

Title: [2.1] Mail template partly rendered in language of posting, not receiving, user?
Post by: m4z on February 18, 2020, 03:35:16 PM
Today I received a notification (my forum language is English):

--SMF-4803df5f023c89a84ef201a8a5[...]
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

A new topic, '<redacted>', has been made on a board you are watching.

You can see it at
https://www.simplemachines.org/community/index.php?topic=[...].new#new

More topics may be posted, but you won't receive more email notifications until you return to the board and read some of them.

Unsubscribe to new topics from this board by using this link:
https://www.simplemachines.org/community/index.php?action=notifyboard;board=[...]

Saludos,
El equipo de Simple Machines Community Forum.
--SMF-4803df5f023c89a84ef201a8a5[...]--


Notice the complimentary close. I checked, and the user who created the topic has his language set to Spanish Latin.


(I suspected this for quite some time, because some weeks back, I had the same issue with closing asian characters.)
Title: Re: Mail template partly rendered in language of posting, not receiving, user?
Post by: Illori on February 18, 2020, 04:06:34 PM
i know this has been reported before, right now i cannot locate the existing bug on this issue.
Title: Re: Mail template partly rendered in language of posting, not receiving, user?
Post by: live627 on February 18, 2020, 07:08:03 PM
After reading and sifting through the code,  (very complex and hard to reed!)I think  can envision a possibility of something similar happening. Note that it  isn't associated with the poster's language.

We are dealing with two different language files here.

User A is English, everything is loaded fine for them.
User B is Spanish, everything is loaded fine for them.
User C is English, the signature text is reused from Spanish.

The code that loads the email template is fine  and reloads language every time.




Find in ./Sources/tasks/CreatePost-Notify.php at line 255

if (empty($parsed_message[$localization]))

Replace with

// if (empty($parsed_message[$localization]))


NB: The same notify path is used for both new topics and new replies as well as moderation actions on topics  that you watch.
Title: Re: [2.1] Mail template partly rendered in language of posting, not receiving, user?
Post by: shawnb61 on February 23, 2020, 06:13:13 PM
Confirmed, & logged here: 
https://github.com/SimpleMachines/SMF2.1/issues/6028

I am definitely seeing issues, specifically with the salutation - exactly as noted above. 

Note it is an intermittent issue - it worked fine for my first 3 or 4 mail notifications, before failing a couple of times. 
Title: Re: [2.1] Mail template partly rendered in language of posting, not receiving, user?
Post by: live627 on February 23, 2020, 06:36:20 PM
I think that it can become a persistent thing if all three user's notifications get queued up and run at once. Might need to cripple cron for that.
Title: Re: [2.1] Mail template partly rendered in language of posting, not receiving, user?
Post by: Illori on February 23, 2020, 08:13:16 PM
also this is not just an issue for SMF 2.1 as this topic is flagged. we have seen this many times here on sm.org.
Title: Re: [2.1] Mail template partly rendered in language of posting, not receiving, user?
Post by: shawnb61 on February 23, 2020, 10:42:31 PM
OK, I logged internally as #145 as well.