Updated to 2.8.4 and PHP 8.1.5 (from 2.8.3 with PHP 7.4)

Everything works fine in manager, EXCEPT updating user. When right-clicking and choosing “Update User” in users list, I get to a 500 ERROR.

Tried to enable PHP error logging. But still no entries in log file.

What can be the issue?

What log file do you mean? The MODX error log (core/cache/logs/error.log)? 500 errors don’t get written to this file.

There should be a different PHP error log file somewhere on your server. The exact location depends on how your server is set up.

Yes, I configured the PHP error log file in php.ini and restarted PHP service on server, also restarted NGINX service.

Any log entries should go to this file i configured: “/var/log/php/fpm-error.log”

I tried to reproduce the issue with the same MODX and PHP versions, but I don’t get an error.

Do you have custom plugins (or maybe plugins from installed extras like e.g. ClassExtender) that run on the events OnUserFormPrerender or OnUserFormRender?

Yes, I have installed the extra ClassExtender from Bob Ray. It is critical to my site as it extends my modUser. Does anyone know how to fix this?

Have you confirmed that the extra ClassExtender causes the error? For example by temporarily deactivating the plugin “ExtraUserFields”.

I tested ClassExtender (with the default fields) on my installation and still get no error.

I tried deactivate the plugin “ExtraUserFields”, but still same error, 500 error.

So I think it is not what is causing the error.

I found out that if i deactivated the plugin “HybridAuth” I could access user update form in manager. So now I have to find out what sort of code that makes PHP break the page.

It uses the system event “OnUserFormPrerender”.

I couldn’t see anything in the HybridAuth snippet or plugin that would be a breaking change for PHP 8.1.

The only things the my code editor (PhpStorm) flagged are several calls to getService() inside if statements. I wouldn’t think that’s the problem unless the getService() code has changed in 2.8.4.

getService() is deprecated but that also shouldn’t be an issue until MODX 4.

You might first try reverting to PHP 7.4 to see if the problem is caused by PHP 8 or by MODX 2.8.4.

Thank you for your input Bob. MODX 2.8.4 works fine on PHP 7.4. I can see the tab “Auth Providers” created by HybridAuth in user update form.

As i can see in the HybridAuth plugin:

case 'OnUserFormPrerender':
        /** @var modUser $user */
        if (!isset($user) || $user->get('id') < 1) {
            return;
        }
        $path = MODX_CORE_PATH . 'components/hybridauth/model/hybridauth/';
        if ($HybridAuth = $modx->getService('HybridAuth', 'HybridAuth', $path)) {
            $HybridAuth->regManagerTab($modx->controller, $user);
        }
        break;

Leads to this section in …/core/components/hybridauth/model/hybridauth/hybridauth.class.php, I have tried to comment out each line one by one, but leads to same 500 ERROR:

public function regManagerTab($controller, $user)
    {
        $this->config['user_id'] = $user->id;
        $controller->addCss($this->config['cssUrl'] . 'mgr/main.css');
        $controller->addCss($this->config['cssUrl'] . 'mgr/bootstrap.buttons.css');
        $controller->addJavascript($this->config['jsUrl'] . 'mgr/hybridauth.js');
        $controller->addJavascript($this->config['jsUrl'] . 'mgr/misc/utils.js');
        $controller->addJavascript($this->config['jsUrl'] . 'mgr/widgets/service.grid.js');
        $controller->addHtml('<script>HybridAuth.config=' . json_encode($this->config) . '</script>');
        $controller->addLexiconTopic('hybridauth:default');
    }

You should probably report the issue here. You might get some help from the author.

Thank you. I have reported the issue there.