Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Birthday alert generates a blank message and errors in log #3134

Closed
margarett opened this issue Nov 19, 2015 · 3 comments
Closed

Birthday alert generates a blank message and errors in log #3134

margarett opened this issue Nov 19, 2015 · 3 comments

Comments

@margarett
Copy link
Contributor

If a user chooses to receive its birthday notification via alert, the generated alert is empty and it generates errors in the log: one in the popup and other in the alerts list

Undefined index: text
http://localhost/smf21_clean/index.php?action=profile;area=alerts_popup;u=1
File: C:/xampp/htdocs/smf21_clean/Themes/default/Profile.template.php
Line: 116

Undefined index: text
http://localhost/smf21_clean/index.php?action=profile;area=showalerts
File: C:/xampp/htdocs/smf21_clean/Themes/default/Profile.template.php
Line: 583

I tried to debug this for a while but I can't understand how the alert system works under the hood...

@Oldiesmann
Copy link
Contributor

Can you provide me with the data for those alerts? The text is set based on the content_type and content_action (see the fetch_alerts function in Sources/Profile-View.php). If it's not set, then that means the language string for that combination of type and action doesn't exist.

@margarett
Copy link
Contributor Author

Ups, I forgot about this, sorry.

There is no data I can give you, really, other than the error log. Because the alert message I get is empty 👅

Just go to your notification preferences and set "When it's my birthday --> Receive alert"
Then go to your forum profile and set your birthday for today.
Finally go to Scheduled tasks and choose "Run Now" for "Send Birthday Emails". You'll get an alert (and an error in your log), when you choose the alerts and "All alerts", you'll get the second error in the log. The birthday message is empty in both cases (of course, it's the undefined index 👅 )

@margarett
Copy link
Contributor Author

Eh, found something. It seems that there is a typo in Alerts.english.php

$txt['alert_birthday_mag'] = '{happy_birthday}';

Looking at smf_user_alerts, content_type is "birthday" and content_action is "msg" so that text key should be "alert_birthday_msg". Bingo, that kills the error :)

The problem is that it seems we're receiving the email template in the alert :(

Dear {REALNAME}, We here at {FORUMNAME} would like to wish you a happy birthday. May this day and the year to follow be full of joy. {REGARDS}

edit: I see it, we are not processing the replacements. Maybe I can still fix this after all 👅

margarett added a commit to margarett/SMF2.1 that referenced this issue Dec 1, 2015
Signed-off-by: Bruno Alves <bruno.m.alves@gmail.com>
margarett added a commit to margarett/SMF2.1 that referenced this issue Dec 1, 2015
Signed-off-by: Bruno Alves <bruno.m.alves@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants