MODX Community

Uncaught TypeError: Cannot read property '1' of null

Summary

Quick summary what this issue is about.

Hello, i am trying to solve issue with saving new template (or change the settings)
Just bought shared hosting with Cpanel from “namecheap.com” and made fresh instal of MODX Revolution

Step to reproduce

The issue occur every time when i try to save new template. It is did not saving. Window “please wait” opens and nothing happens. Same happes when i try to change modx settings
For example if i make new template with this content
<met charset="UTF-8">
it will save fine
but if i try to save with this line,
<meta charset="UTF-8">
it gives me same error

Observed behavior

Expected behavior

Template should saving

Environment

MODX Revolution 2.7.1-pl (traditional)
php 5.6 or php 7.3 (no difference to this issue)

1 Like

Hi, pls check your paths in the three config files on the server. It looks like your connectors path isn’t right, see the first error in the list

The fact that it will save if it’s not a true meta tag almost certainly means that mod_security is messing with you.

2 Likes

Ah, the behavior was exactly what mod_security would do, but I wasn’t sure.

Yeah, mod_security is a pain, you’ll probably need to ask your hoster to relax the mod_security settings.

Do you have a lot of text on your page? That’s what happened with me.

yes, you are right, hosting support helps me
Thanks

1 Like

Lol was @bobray that can speak definitively, not me.

It was a bit of a struggle for me, because of all my text on one page, actually several pages of lots of different text. Maybe you can search for possible causes given your content.

If your hoster can give you more feedback, they should be able to see exactly which triggers (rules) were violated. You may have trouble on shared hosting, I am not sure. The newish rules are tough.

I believe at least in some cases simply turning mod_security off for the manager folder of the Modx install could bring relief. We’ve discussed this possibility and feel it holds very little risk, as Modx sanitizes all requests and these are internal calls. Theoretically with a rogue back-end user it could lead to additional vulnerability, but given that a rogue user can do a lot of damage anyway…it doesn’t lead to much extra risk.

I went through a month-long process of triggering, complaining, having them relax the rule (only one will trigger per time lol) and then back again, it sucked

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.