I’ve come to a point where I dont know how to proceed. I have a simple snippet which is really hard to debug. When I try to save it won’t save unless I remove some code. But the code is valid php and works on other modx sites.
My ModX version is up to date, same as all the extras.
What I do:
Insert the snippet
Click save, first error appears (this.mask…)
Click save again, other two errors appear.
The snippet is NOT saved. I just cant make any sense of what is going on here.
I’ve tried to input the snippet code directly in the database but then my site crashes.
Sounds a lot like mod security on the server is blocking the request that saves the snippet. Try looking at your server error and/or mod security logs, or contact your host for help disabling that.
No luck on the logs. There is nothing in there that implicate an error of any kind. Only thing I can think of is the PHP version. The one working is 7.2.34 and the one not is 7.4.
This is the code snippet I want to save. This way I retrieve photo’s on Flickr and save them in a file so I limit the API calls.
Ask the host, there’s a lot of different ways that can be configured. One client of mine has a section in their DirectAdmin panel to manage it, for example.
It could also be a proxy or CDN like CloudFlare that’s filtering, or some other security software, though in my estimation 8/10 times this comes up it is mod_security.
@markh thanks. I have zero influence, the site is hosted at mijndomein.nl They offer no such thing as DA. I have asked if they can put it off for me to check.
@bruno17 no luck there… @halftrainedharry that worked! I can work with the snippet now. Only downside is I still can’t edit it from within the manager. So that won’t save still. But I can edit the .php on the server and it will update in the manager.
Thanks all. It is not a complete fix, but I can move on.
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.