Fixed Argument 1 passed to XF\Repository\ConnectedAccount::rebuildUserConnectedAccountCache() must be an instance of XF\Entity\User, null given

Affected version
2.1.0

rdn

Well-known member
Code:
Server error log
TypeError: Argument 1 passed to XF\Repository\ConnectedAccount::rebuildUserConnectedAccountCache() must be an instance of XF\Entity\User, null given, called in /home/nginx/domains/site.com/public/src/XF/Entity/UserConnectedAccount.php on line 36 src/XF/Repository/ConnectedAccount.php:68
Generated by: Unknown account Feb 15, 2019 at 9:02 PM

Stack trace
#0 src/XF/Entity/UserConnectedAccount.php(36): XF\Repository\ConnectedAccount->rebuildUserConnectedAccountCache(NULL)
#1 src/XF/Entity/UserConnectedAccount.php(30): XF\Entity\UserConnectedAccount->rebuildUserConnectedAccountCache()
#2 src/XF/Mvc/Entity/Entity.php(1580): XF\Entity\UserConnectedAccount->_postDelete()
#3 src/XF/Repository/ConnectedAccount.php(103): XF\Mvc\Entity\Entity->delete()
#4 src/XF/Pub/Controller/Register.php(309): XF\Repository\ConnectedAccount->associateConnectedAccountWithUser(Object(Datio\AllowedEmails\XF\Entity\User), Object(XF\ConnectedAccount\ProviderData\Facebook))
#5 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Register->actionConnectedAccountRegister(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'ConnectedAccoun...', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Register), NULL)
#7 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Register), NULL)
#8 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#10 src/XF.php(390): XF\App->run()
#11 index.php(20): XF::runApp('XF\\Pub\\App')
#12 {main}

Request state
array(4) {
  ["url"] => string(46) "/register/connected-accounts/facebook/register"
  ["referrer"] => string(62) "https://www.site.com/register/connected-accounts/facebook/"
  ["_GET"] => array(1) {
    ["/register/connected-accounts/facebook/register"] => string(0) ""
  }
  ["_POST"] => array(8) {
    ["username"] => string(12) "username01"
    ["accept"] => string(1) "1"
    ["_xfRedirect"] => string(40) "https://www.site.com/threads/608509/"
    ["timezone"] => string(14) "Asia/Hong_Kong"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(38) "/register/connected-accounts/facebook/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.1).

Change log:
Prevent an error if there is an orphaned user connected account record (for a user that doesn't exist) if that connected account is then re-associated with another user.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top