Affects Version/s: 3.7
Fix Version/s: 3.7.1
This is basically the same problem that we already fixed in
MDL-65655 but we haven't covered all the possible causes of failures there.
This new problem has been detected on learn.moodle.net site. The forum mailings and maintenance scheduled task fails with an error like
As has been described in
MDL-65655, the forum mailings jobs end up calling core_user::require_active_user() which throws an exception in several cases:
- if the user has been suspended or their auth method is set to 'nologin' - this case has been fixed in
MDL-65655so such users do not cause exceptions any more.
- if the user is not a real one - e.g. non-existing user record etc. This is valid unexpected situation and throwing the exception is correct.
- if the user is deleted - deleted users should never be returned as subscribed because we use get_enrolled_sql() which implicitly filters out deleted users.
- if the user is the guest user - the guest user is filtered out explicitly in the forum's fetch_subscribed_users() method
- if the user has not been confirmed yet - this is the last case that we do not have covered yet
We need to make sure that we do not have unconfirmed users returned as notification recipients.