Problems after update to MODX 3

I’m experiencing problem on several sites after updating to MODX 3. There are codes visible on pages like:

[[If? &subject=`0` &operator=`!empty` &then=`

[[!getResources? &parents=`9` &tpl=`sidebarTpl` 


Strange thing is, on other pages with the same template and codes there are no problems. Anyone seen this before?

Is this MODX 3.0.3?

If so, apply these pull requests and check if that helps.

I think it’s been there a few versions. I’m not familiar with Github: what is the solution?

In the pull requests I linked above, go to the tab “Files changed”. Ignore the file with the tests (modParserTest.php), but download the other file and replace the existing file on your server with this new file. Make sure you do this in MODX 3.0.3.

Okay, I tried to edit the PHP files in MODX, it gives me an error:
file extension ‘PHP’ not allowed

You have to add php to the list of “Uploadable File Types” in the system setting upload_files if you want to be able to edit PHP files in the manager.

But don’t do this. Use FTP to upload the new files.
(And save the old files, in case something goes wrong. So that you can restore the previous state.)

Done, and the codes are gone from the pages now. Yes, I made backups :slight_smile: .

Btw, why are these files not included in 3.0.3 update?

These pull requests were only merged, when 3.0.3 was already released.
But they should be included in the next version.

Ah, I see. At my sites these problems were around since late 2022.

It took us some time to find solutions for these issues. We also made sure to add various use cases to our testing suite to prevent it from breaking in the future.

Glad you found the flaw!