Bruno17/MIGX — pull request #56 by eprochasson (2012-12-08 03:44:57+00:00)
Title: Fix Firefox/Chrome bug with TinyMCE

Hi,

this /should/ fix a bug with firefox/Chrome when using tinyMCE.
With Chrome, the content of the tinyMCE editor is randomy not saved.
With some version of Firefox, tinyMCE simply crashes the whole thing.

What I did is:
- change the first line of migx.tpl (I think I revert it back to the previous version). Don't know why it was not working, that's very minor and probably independant, I'll let you fix it back
- move the tinyMCE initialization to the processor part, so it only initializes once all the DOM is loaded. Also, there is now only one initilaization.
- add a "removeTinyMCE" method, that basically removes all the instance of tinyMCE started by MIGX, by simply telling MIGX to not screen them anymore (no more triggerSave or other stuff that was randomly breaking with Firefox).

TinyMCE is voodoo stuff, it seems to work, but I don't know why it was not working before.

I tested it with Chrome and Firefox, and it /seems/ to work. Now, since it was a random bug, it's hard to tell if it is fixed (other correction only decrease the probability of failures), but at least I can resume working on content edition now. Please test that before merging it.

It notably fixes the infamous "NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMHTMLDocument.implementation]" error with firefox (that I paste here mostly to help other users with the same problem) as discussed in http://forums.modx.com/thread/79760/possible-bug-with-tinymce-in-combination-with-migx-migxdb?page=2