MODX Community

Unable to save template adjustments

Summary

Want to save adjustment to template code, it tells me that it was saved but when I open it again, it is not saved. Also codemirror won’t display, tried de-installing, re-installing doesn’t seem to work, but also no errors are displayed.

Expected behavior

The code should be able to save.

Environment

version 2.6.5.

1 Like

This sounds like a possible mod_security issue, where the file is not able to be saved.

Can you save a blank template, or a template with just some very simple code?

Did you find any other files that also cannot be saved? Or just templates?

I’m able to create a new template and save some code in the new template. I haven’t found any other templates or files that I can’t save. So it seems to only affect existing templates.

1 Like

I would definitely contact your hoster and ask whether any mod_security rules were tripped.

Did this just happen out of the blue? Sometimes they update their rules

I don’t think its the existing or not existing issue, you can try copy and pasting or even just duplicating your template and see if that saves…

The strange thing is, I can duplicate the template, but when I try to edit the duplicate template it won’t save the edits either. And there is the issue of code mirror not showing. Tried deinstalling, reinstalling, clearing cache (via manager and manually) but no luck so far…

Update: I’ve tried creating a new template, with very little text. This saves, even when I edit the text, but when I copy and paste the code from the original (non-saving) template it won’t save…

1 Like

Ok this still looks like mod_security to me

Do you have a lot of text in your tpl by chance? With my site I had a lot of text in one place and it tripped mod_security repeatedly, with this sort of result: certain files would not save.

I would definitely talk to the hoster? They could tell you if something is going on on their end.

Also you could watch the developer’s console in your browser for any errors that pop up while saving.

Oh, I should ask, anything in the Modx error log?

Thanks for your help so far…

I’m not very familiar with mod_security but will definitely ask the hoster.

Haven’t checked the developer console yet, that is a good tip.

In the error log I was getting:

[2019-11-28 15:38:39] (ERROR @ /home/pdad357032/domains/citylife.nu/public_html/core/xpdo/xpdo.class.php : 644) Could not load class: CodeMirror from codemirror.

But I removed code mirror.

1 Like

Hmm that does look interesting. Did you leave some remnent of codemirror code in that template? Like a chunk call or something? It would seem so, based on that error.

However I am not sure if the codemirror code would prevent saving…hmm maybe it could

Well after checking out codemirror I would say it is not the problem of saving tbh

I’ve tried saving it again in the developer console I get the following error:

[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (index.php, line 0)

1 Like

Yes but we know you can save other templates, I would think that error is because mod_security has tripped a rule

I contacted the hoster and it was indeed a mod_security issue. They made an adjustment and now it works. Thanks for your help!!!

1 Like

Great news! Glad you are sorted!

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