MODX fatal error line on my home page?

I have just randomly clicked on my website and to my shock/horror I don’t have a website anymore, just a single MODX fatal error line of code.

Can anybody tell me what this error is:

If you don’t want to click my site to see this error, here it is:

Fatal error : Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /homepages/0/d407911120/htdocs/core/model/modx/modx.class.php on line 690

I haven’t done anything. The only thing I did a few days ago was in my IONOS (the hosting company that I use) was update the version of PHP as I had an email from them saying they will start charging me if I stick with the old one so I updated the PHP to PHP 8.2. I checked my site straight away and all was fine so I forgot about it. Today I did my weekly check on my site and I have this line of code. So I went back into my IONOS to change the PHP version to 8.1, which is the recommended one. Before it was on 7.something. I don’t know why the 8.1 version has ‘RECOMMENDED’ written next to it in bright green while the later 8.2 does not. Anyway, I’ve changed it back to 8.1, the recommended one, which is still an upgrade from the 7… (can’t remember which 7 version it was) so I don’t know if this PHP upgrade caused this issue. But right now (2 minutes after going from 8.2 down to 8.1 my site still has this line of code error on it.

Either downgrade to PHP 7.4 if your host still offers that option, or upgrade MODX.

That issue has been fixed for a while (I don’t immediately have the exact version handy, but it was fixed in one of the 2.8.x releases IIRC) and does indeed get triggered with the upgrade to PHP8.

Thanks, Mark

I can downgrade to 7.4, but hosting company will charge me monthly for it so I’d rather upgrade MODX, but here is where the problem lies. My friend built my site for me and chose MODX as the back end and I don’t know too much about MODX and I would be a trifle scared to try and upgrade it in case I mess something up. I remember looking at upgrading MODX a few years ago and the process looked too scary.

In the meantime I’ve gone back to PHP 7.4 and my site works again, but I’d like to upgrade MODX so I can upgrade PHP version and, hence, not have to pay my hosting company a monthly fee.

I think the MODX version I have is MODX Revolution 2.7.0-pl – at least this is what it says at the top left when I log in to the back end of my site.

Is there anybody who could be kind enough to outline some ‘layman’s’ terms of how I can do it myself?

Thanks kindly.

I would suggest installing the UpgradeMODX Extra, which lets you upgrade with the click of a button from within the manager.

Doing a full site and db backup before doing so is always recommended.

Usually it is also advised to not jump straight to the newest version, but include all major versions beneath that as well. Not sure if that’s the case for 2.8 but it won’t hurt either.

So I would recommend updating to 2.8.0 and then again to 2.8.5 which is the latest MODX 2 version.
Don’t upgrade to any MODX 3 version (Upgrade MODX usually won’t even show these, but just in case) as there’s a bit more to check if your site is ready without breaking.

Oh crumbs. This sounds too much for me. How much to MODX guys charge to do upgrades on sites for folk like me that can’t handle the complexities of these things? Anybody cheap out there who can do it for me?

Maybe have a look at the MODX Professionals in your area, I’m sure you can find someone to help you out.

If you do have a full administrator account and server access (FTP, SSH, cPanel or DirectAdmin), this is something I could help with too with my business (modmore).

That would fall under what we call premium support, which for a one-time engagement is currently €125/hr. Typical upgrades are pretty straightforward and I’d charge 30-60 minutes for that, but as you’re a few years behind on updates, it would likely be closer to 60-90 minutes to have time for additional testing to make sure everything continues to work as expected.

If you’d like to take me up on that, drop an email to and we’ll take it from there.

But perhaps it’s worth asking your friend that made the site first to see if they can/want to help?

If you’re getting €125/hr for sitting in front of a computer I’m in the wrong bloody business. I’m a starving author hence I can’t even afford half that. Kind of looking more for a favour for a drink than some sort of ‘business’ arrangement. If it’s going to be stupid money I’ll figure it out myself.

Yeah, that’s definitely the business rate. :sweat_smile: I couldn’t write a book to save my life, so we all have our expertise and you deserve to be well rewarded for your skills, too!

I’m sure there are freelancers around who can help for less, as well as agencies who would charge even more. To pay in beer, you’ll need to find someone local that can actually take you up on that :wink:

If you’re reasonably tech savvy, upgrading doesn’t have to be too hard to do yourself.

  1. Backup files and database. If you have cpanel/directadmin, that probably has backups already.
  2. Install UpgradeMODX extra from Extras > Installer. This adds a dashboard widget to your dashboard to start the upgrade. Choose 2.8.4 as target.
  3. UpgradeMODX will update the files. It then sends you to the setup.
  4. The setup is mostly a matter of clicking continue a few times, unless there are any issues.

This whole process takes just a few minutes if all goes well in one go. After that you’ll also want to go through your extras (again in extras > installer) to update those, and then of course go through the site and verify everything works as expected.

Most of the time an upgrade will go fine, but the longer it has been since an upgrade, the bigger the changes have been, and the more likely something breaks.

What you’re paying for when getting someone to do it for you is the experience and knowledge to know where to look to avoid potential issues, and deal with anything that does go wrong quickly. Performing the upgrade itself is just a small part of it, so if you know how to read and google an error message it’s worth trying to upgrade yourself.