Saving Loop on Resources

Summary

This is a new install and everything was working until I added extras to expand MODX capabilities.

Step to reproduce

When editing and saving a resource the save keeps looping.

I need to reload the page to escape it. Changes are saved.

Observed behaviour

In Depreciations Log

modContentType
Deprecated since v3.0 | Replace references to class modContentType with MODX\Revolution\modContentType to take advantage of PSR-4 autoloading.

xPDO\xPDO::getPKType
{core_path}vendor/xpdo/xpdo/src/xPDO/xPDO.php : 1660

xPDO\xPDO::getPK
{core_path}vendor/xpdo/xpdo/src/xPDO/xPDO.php : 1598

xPDO\xPDO::call
{core_path}vendor/xpdo/xpdo/src/xPDO/xPDO.php : 774

xPDO\Om\xPDOObject::load
{core_path}vendor/xpdo/xpdo/src/xPDO/Om/xPDOObject.php : 402

Expected behaviour

Environment

MODX Revolution 3.0.4-pl (traditional)
PHP Version 8.0.30

Most likely, a plugin (from an extra) that runs on the event “OnDocFormSave” throws an error.

Open the browser’s developer tools and go to the “Network” tab. Then try to save a resource. A new request should appear in the list. What’s the response code? 500? Is there an error message in the response content?
If the response code is 500 but there is no error message, try to locate the server error log to see what the actual error message is. (Fatal PHP errors can’t be logged by MODX in the MODX error log.)


If you can’t find any error message, temporarily deactivate the plugins (that run on the event “OnDocFormSave”) one by one to see what plugin causes the error.

1 Like

Thanks for your help. I did all the deactivating earlier and couldn’t find the issue.

I’ve been poking around and found a resolve.

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Still getting the Depreciations Log notices but at least the resources save pronto.

Thanks to [bobray] it seems we can turn this off by changing the log_deprecated System Setting, (though it’s often helpful to see what’s in there).

I might just toggle it from time to time.

Saving Loop on Resources is Back

I deleted all pluging-ins, cleaned everything up; did all sorts of PHP level tests and have finally found the ‘real’ problem.
It’s a browser thing. Firefox.
Currently no saving loops if I edit in Google Chrome or Microsoft Edge.

I have the same issue with Firefox - but only on certain sites, and it doesn’t happen every time - I will use Chrome for a while and see if it happens.

1 Like

If it’s a browser thing, there must be information in the browser developers’ console that can pinpoint the problem.

Next time it happens, pop open the console and make note of what’s in there. If it says something about “unexpected < character” it’s still a server-side issue, and you’ll need to inspect the AJAX responses to find the root error.

1 Like

Also experiencing this on MODX Revolution 2.2.15-pl. Switching to Chrome (from FireFox) did solved it. Thanks

If that’s not a typo, you’re running a 10 year old version of MODX with a number of known security issues. Upgrade.