I've built a multi-column layout template with MIGX using the tutorial in rtfm. Over the last two days I've added a number of additional fields, tabs, variables etc. I have a working page where I've added numerous migx records for various layouts. All functions are working perfectly, adding, editing new layouts, preview, etc.
All good until today.
I set this up on a brand new modx install 2.5.0. Today I used Packman to package up my template, TVs and Chunks to install on another site. I opened up the manager and tried to add a new layout record and save the page. The save button merely blinks when I click and nothing happens. If I remove the new migx record and click save, it saves the page.
I went back to the original site where I set this all up. Same problem. Ican't save new or edited records.
The page does have several existing records that I created yesterday. I can duplicate an existing record save it. I can edit the contents of the fields and save the record. However, I if I try to change a record from a one column layout to a two column layout (form with two tabs vs one), the page will not save.
The grid, the tabs, all the fields are working correctly. Usually, if there is a missing bracket or something, the tabs will be empty, but that's not the case here.
There are no error messages anywhere that I can see. The modx error log is empty.
This was working perfectly, yesterday.
I'm at a loss as to how to troubleshoot this. Any ideas?
It could be an issue with mod_security at the host. The mod_security rules get changed fairly often and hosts will never notify you about it. It's the most likely cause of the inability to save specific MODX objects. There may be something in the MIGX TVs that mod_security doesn't like.
So this happened on two different sites at the same time? Hmmm.
Something in the TV? Content, images, text, links? Type of tv? Name?
How would I narrow this down short of rebuilding it from scratch?
If the two sites are at the same host, it wouldn't be surprising to have both affected at the same time.
Usually it's triggered by either an offending word (one user reported that he couldn't save anything containing the word "casino"), or more likely, something that might look like a malicious script.
Something else to try, in case it's not mod_security, is to turn on Chrome dev. tools (Ctrl-shift-i), and watch the Network tab as you save. You can drill down to see the response from the processor. There may be an error message embedded in a bunch of ugly HTML. You can copy and paste it into an HTML file to view in a browser if you can't find the error message.
I duplicated this and put it on another page and added a new migx layout record with no content. I'm still unable to save the page. So it seems that content is not an issue (if there isn't any) and the json code for the tabs and grid is just more of the same code from the tutorial with a few additional text fields, a radio button, and resource list tv.
I did check the network tab on the developer tools. I watched as I added and edited the migx records and drilled down into each one. Nothing jumped out at me, no obvious error messages, but I have to say I'm not sure I know what I'm looking for there.
When I'm ready to save the page, clicking on the save button, generates NO communication with the server. The button just blinks (like when you hover over it), but nothing is happening on the network tab.
My hunch is this problem is related to the hidden fields in the json code for the tabs. I added additional tabs but no additional corresponding hidden fields. I'm not sure what the purpose of these are, but I suspect there should be a parallel structure with those hidden fields and the tabs. And yet it was working before. I'm looking into this.
any chance to get manager-access for me?
probably the fastest way to see, what goes wrong.
Oddly, today I'm able to save normally. I don't know what's changed from yesterday.
Since it's working now, I'll keep working on this. If I have trouble saving again. I'll send you a login.
Thank you so much!
Others have reported trouble saving Templates with JS code (direct or indirect) in them due to CloudFlare. It's possible (though I think not very likely) that this is/was your problem.
I wanted to report back on this. I've had no trouble saving any Migx records today. However, I have been able to recreate the problem.
If I have a Migx record with data in four tabs/columns and save it, then edit the record and change the layout format to three tabs/columns, the record will not save. I tried clearing out all the data in the fields in the forth tab/column, but the page still would not save. When I delete the record, the page will save.
I do have a radio button field on these tabs, so I suspect that without a null value radio option, that field is retaining a value (not tested). I'm not sure if values in these fields would or should cause the page to not save.
For now this will keep me moving forward, but if you have any other insights, that would be great. And yes, I can provide you a login if you're still interested.