Hi guys, I have a vps with all the right requirements. When I try to save a template on my modx install, or a chunk with any code in it I’m getting the following console errors:
[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (index.php, line 0) (connectors/index.php)
[Error] TypeError: this.mask.addClass is not a function. (In 'this.mask.addClass("fade-in")', 'this.mask.addClass' is undefined)
onShow (modx.jsgrps-min.js:1:114390)
afterShow (ext-all.js:21:375934)
show (ext-all.js:21:375358)
show (ext-all.js:21:387130)
onAjaxException (modx.js:122)
fire (ext-all.js:21:3705)
fireEvent (ext-all.js:21:693)
handleFailure (ext-all.js:21:51291)
f (ext-base.js:21:18146)
m (ext-base.js:21:18304)
(anonymous function) (ext-base.js:21:8610)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (modx.jsgrps-min.js.map, line 0)
and if I navigate to connectors/index.php I see the following:
{"success":false,"message":"Access denied.","total":0,"data":[],"object":{"code":401}}
So I go to my code and see this:
/* check for anonymous access or for a context access policy - return error on failure */
if (defined('MODX_REQP') && MODX_REQP === false) {
} else if (!is_object($modx->context) || !$modx->context->checkPolicy('load')) {
header("Content-Type: application/json; charset=UTF-8");
header($_SERVER['SERVER_PROTOCOL'] . ' 401 Not Authorized');
echo json_encode(array(
'success' => false,
'code' => 401,
));
@session_write_close();
die();
}
Gotcha. I’m going to see 401 anytime I try to access that file with a browser. Ok.
So I search forums. I find that EVERYONE has this issue who has mod security. Cool So I disable it. First on the domain then on the whole server.
STILL SAME ISSUE
I explain all of this to my tech support team at the datacenter. They insist this isn’t a server problem.
It’s a server problem.
I’m pretty darn sure that forbidden error is because of some security rule. I’ve checked file and directory permissions and cleared cache by hand and with the button. Flushed permissions. used a private browser. Changed my session variable in the settings to “/” and to “/modx/” which is my current subdirectory. I’ve installed by hand, different versions. I’ve used Softaculous. Same issues. I’ve checked the server logs for ANYTHING I can find.
I can duplicate a template with code in it. It works. (Dupe the included base template)
I can also create an empty template. Chunks or templates with html seem to trigger it. I saved a chunk of php successfully in a template.
There is no cloudflare running.
This is for me, to create a modx site for the new fantasy fiction book that I have written. FREE COPY to whoever helps me figure this out. I really need help.