ErrorException: [E_WARNING] Trying to access array offset on null src/XF/ConnectedAccount/ProviderData/XenForoProviderData.php:22

GameNet

Active member
Affected version
2.3.0
Hi

I am receiving errors in my adminCP

Error code:
Code:
ErrorException: [E_WARNING] Trying to access array offset on null src/XF/ConnectedAccount/ProviderData/XenForoProviderData.php:22
Generated by: NICK97 Jul 5, 2024 at 5:46 PM
Stack trace
#0 src/XF/ConnectedAccount/ProviderData/XenForoProviderData.php(22): XF::handlePhpError(2, '[E_WARNING] Try...', '/home/citiesmod...', 22)
#1 src/XF/ConnectedAccount/ProviderData/AbstractProviderData.php(175): XF\ConnectedAccount\ProviderData\XenForoProviderData->getProviderKey()
#2 src/XF/ConnectedAccount/ProviderData/AbstractProviderData.php(196): XF\ConnectedAccount\ProviderData\AbstractProviderData->offsetGet('provider_key')
#3 src/XF/Repository/ConnectedAccountRepository.php(91): XF\ConnectedAccount\ProviderData\AbstractProviderData->__get('provider_key')
#4 src/XF/Pub/Controller/RegisterController.php(137): XF\Repository\ConnectedAccountRepository->getUserConnectedAccountFromProviderData(Object(XF\ConnectedAccount\ProviderData\XenForoProviderData))
#5 src/XF/Mvc/Dispatcher.php(362): XF\Pub\Controller\RegisterController->actionConnectedAccount(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'ConnectedAccoun...', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\RegisterController), NULL)
#7 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\RegisterController), NULL)
#8 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2777): XF\Mvc\Dispatcher->run()
#10 src/XF.php(798): XF\App->run()
#11 index.php(23): XF::runApp('XF\\Pub\\App')
#12 {main}
Request state
array(4) {
  ["url"] => string(37) "/register/connected-accounts/xenforo/"
  ["referrer"] => string(24) "https://cities-mods.com/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Safari Screenshot 2024-07-05 17.50.04.webp
 
This seems to imply that the connected account provider is not returning a valid response from the API endpoint. It's worth ensuring the board URL, client ID, and secret, are all set properly.
 
Hmm, same here.

I can run it easily between my two forums, but can't make it work on the other two from my client. Forums are on different servers on different continents (if that matters) and I am constantly getting this:

ErrorException: [E_WARNING] Trying to access array offset on null in src/XF/ConnectedAccount/ProviderData/XenForoProviderData.php at line 22
  1. XF::handlePhpError() in src/XF/ConnectedAccount/ProviderData/XenForoProviderData.php at line 22
  2. XF\ConnectedAccount\ProviderData\XenForoProviderData->getProviderKey() in src/XF/Admin/Controller/ConnectedAccountController.php at line 97
  3. XF\Admin\Controller\ConnectedAccountController->actionPerformTest() in src/XF/Mvc/Dispatcher.php at line 362
  4. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
  5. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
  6. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
  7. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2826
  8. XF\App->run() in src/XF.php at line 806
  9. XF::runApp() in admin.php at line 15

===============

I've checked settings numerous times. Forums are on the same XF version 2.3.4.

What am I missing here?

Thanks.
 
This may be showing up on on servers with a more recent release of PHP. If I'm not mistaken, I think this warning would of started being shown around PHP 8.1.
 
I haven't been able to reproduce this. If you can and are comfortable providing server access, open a ticket and I can get it sorted.
Thank you for getting back, Jeremy. Access to which server? Both?

Or better, what files do you need access to?
 
The server where the error is logged, with admin credentials to view logs and the connected account configuration and the ability to modify at least the files under the src/XF/ConnectedAccount/ directory.
 
Back
Top Bottom