-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.2.6
If a user has an empty email address (which can happen if they are added via LDAP sync, as found in MDL-16328) and they are subscribed to a forum, the notification task will repeatedly fail and retry.
email_to_user() already has a check for empty email addresses and returns false. This false is passed back up the stack to mod_forum\task\send_user_notifications where it is treated as an error, and the task is re-queued even though it will not work the subsequent times unless the user is updated, so will be re-queued indefinitely.
We should handle the case where a user has no email, and skip re-queuing the message in this case, with some output to indicate this has happened.
Steps to reproduce:
- Create a user with empty email address field (can be done by creating a user normally and then removing the email address directly from database).
- Create a course with forum activity and enrol the new user.
- Add a post in forum with forced subscription on.
- Run the Forum mailings and maintenance jobs scheduled task.
- Run the mod_forum\task\send_user_notifications adhoc task.
- It should fail because of empty email address and then be re queued this can be confirmed by checking the adhoc database table.
Expected: The task should not be re queued after failing because of an empty email address.
Actual: The task is re queued even if it fails because of empty email address
- has a non-specific relationship to
-
MDL-80024 Adhoc task \mod_forum\task\send_user_notifications does not consider user.emailstop flag
- Open