I has happened to me several times, I wonder if other people have experienced this (scary) behaviour. Sometimes the editor seems to “eat” the template, i.e. it saves in the database a blank text. Tipically, I’m editing a template, I save and publish , cant see the changes, and when i reload the template in the editor… oooops the text is gone (and the template is marked as ‘disabled’ in the templates list). It’s not that the browser has problems showing it, I look inside the database and the template_text field is actually empty. This sucks badly, as you can imagine. I use Firefox 3, MT 4.23
Reported on Movable Type 4.2
I had something similar once in 4.2 after I copy & pasted some text into a template. The template didn't show up as disabled though. Must have been some bad characters, in the end I deleted the template and started again.
Yes, I've also experience a lot of funny behaviour when copy-pasting inside the template editor. Both in Firefox and IE.
And lots of (seemingly random) blank lines suddenly appearing and disappearing, for example, when pressing the Delete key. I highly suspect that this is related to the "Syntax Highlight" feature, some parsing issue.
I now disable syntax-highlight off while editing, perhaps this should be the default behaviour.
Yeah sometimes it's blank, or it's either half missing or all compressed on one line... I've had this happen enough times that I leave tabs with templates open after saving code.
You can usually use the back menu to jump over the previous save to an earlier state of the template and grab the code pre save to copy it.
I've had this happen several times recently (MT 4.25) - very frustrating. Hitting back didn't retrieve it and I don't know of any version control to undo the damage. I lost a bunch of work the other day - luckily my rewrite was more efficient than my original. In some cases, I've been editing code in a separate text editor and then pasting it from there to be safe.
I also think it might have something to do with the Syntax Highlighting (Codepress), and probably also with pasting into the editor while syntax highlighting is turned on. When the highlighting is turned off it seems like it doesn't happen.
It is raised as a bug
Invisible control character causes truncation of template
http://bugs.movabletype.org/default.asp?90901