Fixed Accounts without an email address trigger error

Paul B

XenForo moderator
Staff member
Affected version
2.1.7
Code:
Exception: Email to [unknown] failed setup: Trying to send email to user without email (ID: 2) src/XF/Mail/Mail.php:83
Generated by: xxx Mar 1, 2020 at 6:54 PM
Stack trace
#0 src/XF/Service/User/PasswordChange.php(121): XF\Mail\Mail->setToUser(Object(XF\Entity\User))
#1 src/XF/Service/User/PasswordChange.php(106): XF\Service\User\PasswordChange->sendPasswordChangedNotice()
#2 src/XF/Service/User/PasswordChange.php(91): XF\Service\User\PasswordChange->onPasswordChange()
#3 src/XF/Pub/Controller/Account.php(654): XF\Service\User\PasswordChange->save()
#4 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\Account->actionSecurity(Object(XF\Mvc\ParameterBag))
#5 src/XF/Mvc/Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Security', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Account), NULL)
#6 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Account), NULL)
#7 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#8 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#9 src/XF.php(391): XF\App->run()
#10 index.php(20): XF::runApp('XF\\Pub\\App')
#11 {main}
Request state
array(4) {
["url"] => string(21) "/217/account/security"
["referrer"] => string(62) "https://123.demo-xenforo.com/217/account/security"
["_GET"] => array(0) {
}
["_POST"] => array(7) {
["old_password"] => string(8) "********"
["password"] => string(8) "********"
["password_confirm"] => string(8) "********"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(21) "/217/account/security"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.8).

Change log:
Add account email check to various places before sending mail
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom