Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted July 20, 20222 yr Hello, We've recently upgraded to the Invision v2.7.0 and changed our PHP version to 8.1 which is supported now. After this change we see some errors coming from the profilesync maintenance task not being able to run due to errors. Our logs go back one week and this error started after the upgrade, prior it was not causing issues. The errors are: TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given (0) #0 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(472): array_key_exists() #1 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(438): IPS\Login\Handler\OAuth2\_Custom::getValueFromArray() #2 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(310): IPS\Login\Handler\OAuth2\_Custom->_userData() #3 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(378): IPS\Login\Handler\OAuth2\_Custom->authenticatedUserName() #4 /var/www/html/public/system/Member/Member.php(4951): IPS\Login\Handler\OAuth2\_Custom->userProfileName() #5 /var/www/html/public/applications/core/tasks/profilesync.php(78): IPS\_Member->profileSync() #6 /var/www/html/public/system/Task/Task.php(367): IPS\core\tasks\_profilesync->IPS\core\tasks\{closure}() #7 /var/www/html/public/applications/core/tasks/profilesync.php(66): IPS\_Task->runUntilTimeout() #8 /var/www/html/public/system/Task/Task.php(266): IPS\core\tasks\_profilesync->execute() #9 /var/www/html/public/applications/core/modules/admin/settings/advanced.php(754): IPS\_Task->run() #10 /var/www/html/public/system/Dispatcher/Controller.php(107): IPS\core\modules\admin\settings\_advanced->runTask() #11 /var/www/html/public/applications/core/modules/admin/settings/advanced.php(38): IPS\Dispatcher\_Controller->execute() #12 /var/www/html/public/system/Dispatcher/Dispatcher.php(153): IPS\core\modules\admin\settings\_advanced->execute() #13 /var/www/html/public/admin/index.php(13): IPS\_Dispatcher->run() #14 {main} I've looked through the code, and tried to call our custom OAuth2 provider with Postman and with an access token, and it returns the data in an array as expected. My hypothesis is that something is broken or a check is missing perhaps for users with expired access tokens? Perhaps PHP 8 changed some argument requirements in some of the functions?
July 20, 20222 yr Before we look further into this, could you confirm if you have checked this already on your previous PHP version?
July 20, 20222 yr Author 1 hour ago, Marc Stridgen said: Before we look further into this, could you confirm if you have checked this already on your previous PHP version? I changed PHP version to 7.4 and the maintenance task ran successfully, so seems to be a PHP 8.1 issue indeed.
August 15, 20222 yr There is no update for this at the present time, however it has been tagged for developers Please could I ask that you test this again on the latest release? Once you have checked this, let us know the result. If you are still having issues, I will then get a bug report opened for you
September 18, 20222 yr Author On 8/15/2022 at 11:45 AM, Marc Stridgen said: There is no update for this at the present time, however it has been tagged for developers Please could I ask that you test this again on the latest release? Once you have checked this, let us know the result. If you are still having issues, I will then get a bug report opened for you Hi again, I've tested again and still experiencing the issue: TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given (0) #0 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(472): array_key_exists() #1 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(438): IPS\Login\Handler\OAuth2\_Custom::getValueFromArray() #2 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(310): IPS\Login\Handler\OAuth2\_Custom->_userData() #3 /var/www/html/public/system/Login/Handler/OAuth2/Custom.php(378): IPS\Login\Handler\OAuth2\_Custom->authenticatedUserName() #4 /var/www/html/public/system/Member/Member.php(4897): IPS\Login\Handler\OAuth2\_Custom->userProfileName() #5 /var/www/html/public/system/Login/Success.php(120): IPS\_Member->profileSync() #6 /var/www/html/public/applications/core/modules/front/system/login.php(92): IPS\Login\_Success->process() #7 /var/www/html/public/system/Dispatcher/Controller.php(118): IPS\core\modules\front\system\_login->manage() #8 /var/www/html/public/system/Dispatcher/Dispatcher.php(153): IPS\Dispatcher\_Controller->execute() #9 /var/www/html/public/index.php(13): IPS\_Dispatcher->run() #10 {main} Invision Version 4.7.2.1 PHP 8.1.10
September 18, 20222 yr Stupid question … does this happen in php 7.4? I’m wondering if this is a php 8/8.1 issue.
September 18, 20222 yr Author 3 minutes ago, Randy Calvert said: Stupid question … does this happen in php 7.4? I’m wondering if this is a php 8/8.1 issue. It's only happening in PHP 8.1 for me. 7.4 does not have this issue.
September 19, 20222 yr I have created a ticket for you on this. Please ensure you access details are up to date, and that your site is currently running 8.1 so we can see the issue
December 12, 20222 yr Author Hi @Marc Stridgen Replying here as it seems the email-reply on the ticket was not accepted. We seen that latest December update seems to perhaps attempted a fix? We'd like to share the issue still persists. The fix is to ask the OAuth source for a json response with [["Accept" => "application/json"]]. If the December update was not meant to fix this yet, is there any estimate for a fix? We'd love to avoid uploading our workaround of this issue for each update 🙂
December 12, 20222 yr Sorry, this was not in the December release but hopefully will be in our next release which will be in February or March at this point due to all the holidays here.