[2.1] Mail template partly rendered in language of posting, not receiving, user?

Started by m4z, February 18, 2020, 03:35:16 PM

Previous topic - Next topic

m4z

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.)
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Illori

i know this has been reported before, right now i cannot locate the existing bug on this issue.

live627

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.

shawnb61

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. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

live627

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.

Illori

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.

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: