Unable to save certain elements

I was updating a property set and when I clicked the “Save Property Set” button I got the “Loading…” alert as expected but it just kept going and the page never reloaded and the changes weren’t saved.

As far as I can tell this doesn’t happen when saving resources, chunks, templates, tvs, snippets, system settings, etc., only property sets. I’ve rerun the installer, cleared the cache, flushed permissions but no change.

Any ideas?

MODX 2.8.7

When you save anything in MODX, an AJAX request to a processor is created to save the changes. What you describe is usually a sign, that the processor fails (for some reason).

When you open the developer tools in the browser, and then try to save the property set, do any errors get shown in the “Console” tab? What’s the response status code and the actual response of the AJAX request to the processor (request parameter “action” = element/propertyset/updatefromelement or maybe element/propertyset/update) in the “Network” tab?

Does this help?

The information from the “Network” tab (of the developer tools) would be more helpful (HTTP response status code and actual response).

This (generic) ExtJS error in the “Console” tab is usually just an indication, that the processor doesn’t return the expected JSON response.

If the HTTP response status code is 500, try to locate the PHP error log file, to get the specific error message.

This is what I see in the Network tab:

XHRPOST
https://mysite.com/connectors/index.php
[HTTP/2 404  154ms]

Cookie warnings 2
Cookie “PHPSESSID” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite index.php
Cookie “PHPSESSID” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite index.php
Uncaught TypeError: this.mask.addClass is not a function
	onShow https://mysite.com/manager/assets/modext/widgets/core/modx.window.js:60
	ExtJS 3
	onAjaxException https://mysite.com/manager/assets/modext/core/modx.js?v=f20d0afb:122
	ExtJS 3
	f https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	m https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	createCallback https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	setInterval handler*n https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	i https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	request https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	request ExtJS
	request https://mysite.com/manager/assets/modext/core/modx.js?v=f20d0afb:654
	save https://mysite.com/manager/assets/modext/widgets/element/modx.grid.element.properties.js:245
	handler https://mysite.com/manager/assets/modext/widgets/element/modx.panel.property.set.js:95
	ExtJS 2
modx.window.js:60:23
	onShow https://mysite.com/manager/assets/modext/widgets/core/modx.window.js:60
	ExtJS 3
	onAjaxException https://mysite.com/manager/assets/modext/core/modx.js?v=f20d0afb:122
	ExtJS 3
	f https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	m https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	createCallback https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	(Async: setInterval handler)
	n https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	i https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	request https://mysite.com/manager/assets/ext3/adapter/ext/ext-base.js:21
	request ExtJS
	request https://mysite.com/manager/assets/modext/core/modx.js?v=f20d0afb:654
	save https://mysite.com/manager/assets/modext/widgets/element/modx.grid.element.properties.js:245
	handler https://mysite.com/manager/assets/modext/widgets/element/modx.panel.property.set.js:95
	ExtJS 2

Make sure you open the “Network” tab first, then save the property set.

For the request with the action = element/propertyset/updatefromelement (or maybe element/propertyset/update),

what is the response status code?

What is the response?

I just noticed that the save issue only seems to affect a single pset for the “responsivefilemanagerConnector” snippet. All other psets can be saved without issue.

Also, I don’t see a “Payload” or “Response” tab in my developer window.

I’ve been called away so this will have to wait for the moment. Thank you for your help so far. If you prefer to see the error for yourself I can give you Manager access.

When you click on the request in the list, the area on the right side (with the tabs like “Payload” or “Response”) should appear.
(That’s at least the case with Chrome or Firefox. I don’t know how it works in other browsers.)


Sometimes a firewall running on the server intervenes to block a ‘suspicious’ request (leading to this behaviour). Usually this is more likely the case with PHP code in a snippet or JS code in a chunk. Not sure why a property set would trigger a firewall.

Screen Shot 2024-09-25 at 3.36.54 PM

It shows the actual (404) error page.

This is weird. The file connectors/index.php obviously exists, or you wouldn’t be able so save other elements or property sets.
Does it show the MODX error page (or a general error page from your hosting provider)?
I see no reason why MODX would return a HTML error page, when a processor is called (via the connector).

My best guess is still, that there is a firewall running on the server, that blocks this request for some reason.

It shows the custom 404 I made.

I also checked several other sites I have that use a nearly identical (responsivefilemanagerConnector) snippet configuration (same “RFM” pset name, settings, paths) and every one fails to save the RFM pset. Those sites are both local (running MAMP Pro 7) and on different remote servers (same hosting provider).

I’ve disabled all browser extensions/blockers. Nothing. I’ve tried saving using different devices: laptop, phone, tablet. No difference. Well, actually there is one difference. Occasionally instead of the page hanging after clicking “Save Property Set” it will intermittently reload but is blank white.

And if that weren’t enough there is a strange upload behavior that appeared around the same time as the saving issue, both of which are configured by the RFM pset. Coincidence? I have no idea.

Fortunately the RFM pset doesn’t require frequent changes so for the time being things remain mostly functional, but that won’t last.

Thanks for your help.

This looks like mod_security to me. I’m guessing that there’s something in your property set that violates a mod_security rule. It could be a key or a value, but more likely a value.

One method to diagnose this would be to remove all the values and see if you can save the property set, then put them back one by one to see which one is causing the problem.

Another way to go is just to remove the most suspicious value and put it back if removing it doesn’t solve the problem. Then do the second-most-suspicious on, and so on.

@bobray Thanks for this suggestion, I will give it a try.