I recently install virtualmin and set up my virtual server etc with no problems what so ever. I’ve been using it for a week with no issues, however now I have found that when I use the file editor to edit php files it removes my php tags ?
If I download the file and edit in notepad++ the code is all there with no issues, if I edit the file in virtualmin then save it saves without any of the php code breaking it all. Recently I have resorted to downloading files, editing them and reuploading them.
I have attached an image below, on the left is virtualmins rendering if my code and on the right is NotePad++ rendering of my code.
Me neither, this isn’t my first Virtualmin install, just out of the blue started happening. So long as I don’t save the files after they’ve changed they still function as perfectly fine php files.
I’m having a hard time coming up with a theory about why/how that would happen.
We don’t really maintain the text editor, it’s CodeMirror with a bit of custom code. It’s possible there’s some way to put it into a mode that would do something like that, but even that seems unlikely.
@Ilia would know better than me, I guess. I’ve never seen it, and I can’t reproduce it.
I just got home from work today after giving up on it last night and now it’s perfectly functional, I can edit files again without them removing my tags.
I’m going to put it down as maybe a caching issue or just a session issue, I’m going to do my best to remember what I’m doing so if it happens again I can recreate it.
This cannot be the source of problem, because we expect multiple files to be opened at the same time.
I couldn’t reproduce it neither.
This is an odd issue. But if this ever happens again, try opening browser’s console and look at network tab to get more details about the consequent call, which destroys the content of the file.
Also, if you change file encoding at top right of editor window, does it break, maybe? Or if you change the encoding, then close the file editor window and re-open it over again, does it break?
By the way, which browser were you using? Did that browser had some fancy extensions enabled?
He was trying to open the same file he already had open. If he has a browser set to run only one instance, it will not allow a duplicate window of the same file to be opened.
I’ve seen it happen before (not in Virtualmin) and that’s what it was - the system didn’t allow multiple instances of files to be opened at the same time.