Snog
Well-known member
Please don't use
Use a finder or some other method, but please don't use that one.
$this->getUserRepo()->getVisitor($userId)
to get a user. That function is what XenForo itself uses to set up \XF::visitor(). And using it to get a user other than the current user can wreak havoc with any add-on that is using the visitor_setup listener and depends on the info being for the current visitor.Use a finder or some other method, but please don't use that one.