Why Some Resources Can't Be Saved

A look at problems that can keep you from saving a resource


Every once in a while, you may find that you can't save a resource. Sometimes, you'll get a message, but in other cases, the "Saving" progress bar will never go away. In this article, we'll look at some reasons why that might happen. In addition to resources, some of these issues can also affect saving other MODX objects such as chunks and templates.


MODX logo

Server Issues

If you are on a shared server, the database may be overloaded. If the server connections are maxed out, or if the save times out because so many other people are saving things to a database at the same time, your save may fail. This is a likely cause if the problem is intermittent and happens with many different resources. Usually, you'll see an error message in the MODX error log. It might give you a warning about too many simultaneous connections. Occasionally, you'll get a somewhat poetic message saying, "The server has gone away." You can take this up with your host, but sometimes the best solution is to change hosts or upgrade your hosting package.


Date/Time Issues

This doesn't happen very often, but occasionally a mismatch between the date/time settings in MODX, PHP, or the server can cause save failures. The solution is to make sure those settings are all the same. The server setting can be set in .htaccess or php.ini, and the MODX setting is in the date_timezone System Setting.


mod_security

If your host is running mod_security, there are a set of rules that prevent certain content from being saved. These rules can be updated by your host at any time. They may prevent certain kinds of code from being saved, but in many cases they can be arbitrary and very odd. In one case a MODX user was unable to save any resource containing the word "casino."

This is a likely cause if there is a specific resource, chunk, or template that can't be saved while all others can be saved with no problem.

You can try removing the content from the object you're trying to save. If this fixes the problem, it's almost certainly a problem with mod_security. You can put back the content, one paragraph at a time, until it breaks. Then remove pieces of the offending paragraph until you find the specific part that's violation the mod_security rule. Sometimes, you can rewrite the content to avoid to problem, but often you'll have to contact your host and ask them to turn off the rule for the site or for the page.


Permission Issues

If you get an "Access Denied" message when you try to save something, this is a likely cause. The current user may have permission to edit the object, but not permission to save it. If you have recently changed the permission settings, this is almost certainly the problem. The Context Access Policy may have a "save" permission unchecked, Resource Group or Element Category Access Policy may be missing the save permission. A quick way to diagnose this it to temporarily make the user a "sudo" user. If that solves the problem, it's definitely an issue with MODX permissions. Don't forget to remove the user's "sudo" status after testing.


TV Problems

This only applies to Resources and it's particularly insidious. If there is a TV that has "Allow Blank" set to No, you can't save the resource unless that TV has a value. If you're looking at the TV tab, you'll see an error message and a red outline around the TV value's input field. Often, however, you won't be looking at the TV tab and you won't see the message.

Check all the TVs on the TV tab as you try to save to see if you get a notice about an error condition.


Coming Up

In the next article, we'll look at what's new in NewsPublisher 3.0.


Looking for high-quality, MODX-friendly hosting? As of May 2016, Bob's Guides is hosted at A2 hosting. (More information in the box below.)



Comments (0)


Please login to comment.

  (Login)