Cannot login to manager - Deprecated each() function xpdoquery.class.php

An old client contacted me that their IP changed on the hosting.
I have updated the IP and now the website does not load images with a PHP warning,

Logging in to the manager I get the same warning with no ability to login.
The login page with username password works fine

Deprecated : The each() function is deprecated. This message will be suppressed on further calls in /home/viabridg/public_html/core/xpdo/om/xpdoquery.class.php on line 695

I assume the hosting upgraded their PHP version, and upgrading MODX or xpdo tools will resolve it if I could log in to the manager,

Link to the site:

Thank you

If you go into the DB in PhpMyAdmin, and in the modx_system_settings table, change the value of the log_deprecated setting value from 1 to 0. That will turn off the warning, but I’m not sure it will let you log in.

If you have Captcha enabled for the Manager login, try turning that off as well (in the same table). Change the captcha.enabled setting value from 1 to 0…

After changing the settings, manually delete all files in the core/cache directory before trying to log in.

Thank you!
But I cannot see this setting, the MODX version installed is probably older.
I thought on upgrading the modx version through CPANEL but read the big warning to upgrade all plugins before that - Which I cannot do as I’m already locked out of the manager.

My best guess is the xpdo is locking me out as it’s not working with the PHP update on siteground hosting.

Are there any other ideas before I try upgrading MODX and cross fingers?
The warning response after logging into a blank manager:

Deprecated : The each() function is deprecated. This message will be suppressed on further calls in /home/viabridg/public_html/core/xpdo/om/xpdoquery.class.php on line 695

Thank you

I think the solution for the website images might be to use an uncached tag (with the exclamation point) for the site url in the base href tag in all your templates:

<base href="[[!++site_url]]" />

You could add the exclamation point in the modx_site_templates table in the DB, though it would be pretty tedious if you have a lot of templates.

I don’t think that will help you log in, though, and I doubt if the deprecation message is related to the Manager login problem. (I could be wrong.)

I’d suggest firing up Dev. Tools in Chrome or FF (F12 or Ctrl-shift-i) and watching the Network tab as you try to log in. You could do the same thing for the images if the tag thing above doesn’t work to see where it’s looking for the images.

Look for any non-200 response in the grid. Also, hover over each line starting from the top and look for a change in the domain or protocol (e.g., https to http).

Another thought on the images: is it possible that you have a media source with a hardcoded path to the old URL?

Thank you for your help,
The Response from the server was 200ok only with the PHP warning.
The solution was finally to roll back the PHP version and everything is now working.

Now I see MODX version is 2.5.5, I will upgrade as required and try to update again the PHP.
Worst case I will remain with older PHP version.

p.s. final flow:
downgrading to PHP 7.1 from CPanel
Logging in to manager, updating all extras
Upgrading MODX 2.5.5 to 2.7.3
Upgrading PHP 7.1 back to 7.3

All is good now
Thank you,

I’m glad you got it sorted. Thanks for reporting back. :slight_smile:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.