Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TwoD’s picture

Title: Form not saving, TinyMCE issue. » Form not saving, NS_ERROR_UNEXPECTED
Component: Code » Editor - TinyMCE

The error is an internal FF error and I doubt there's much we can do about it in Wysiwyg since it does work in other browsers and happens inside TinyMCE itself.
Have you tried disabling all Firefox extensions and/or running Firefox in safe mode?
If possible, a stack trace from exactly where the error is thrown would be helpful.

I found http://www.tinymce.com/forum/viewtopic.php?pid=22977 which discusses this error and seems to find it related to accessing an editor instance after it has been removed, but I can't for sure say that is the cause here. It does seem likely though since the code snippet included with the error tries to access a document object, and possibly one which no longer exists.
You appear to be editing the content inside a modal dialog over the Drupal Overlay modal, possibly with more TinyMCE instances inside the Overlay. It's possible that there is some confusion about which instances are still available once the "inner" modal closes and the content gets submitted.

I can't say why running the minified TinyMCE code through a pretty printer fixes the issue, but perhaps it's a timing thing?
Compressed code could possibly run slightly faster, leading to race conditions? Or, the browser's JS engine gets confused by the syntax when the code has been compressed and interprets things differently... This is very difficult to debug and would likely take a lot of time. :/

Removing the textarea is a really bad idea. TinyMCE needs the original textarea for storing the generated markup into or it won't get included when the form is submitted to the server. This is why you get the $field.val(...) is undefined error from within Wysiwyg's TinyMCE integration script. (Btw, your stackexchange question appears to instead say that the NS_ERROR_UNEXPECTED error is thrown after the textarea has been removed, while that's actually the initial error.)

Elijah Lynn’s picture

Status: Active » Closed (fixed)

Thanks TwoD, Todd Tomlinson tracked this down and found a fix for it.

The fix is here. => http://www.tinymce.com/develop/bugtracker_view.php?id=3152

Elijah Lynn’s picture

I am going to use this comment to attach a diff since the TinyMCE bugtracker doesn't let you upload files.

Attached is the diff to apply to 3.5.6 of tiny_mce.src.js, then you need to minify that with http://javascriptcompressor.com/ and replace the contents of tiny_mce.js.

Addendum: This patch/diff will actually replace the contents of tiny_mce.js for you, you don't need to recompress/minfy it.

TwoD’s picture

Thanks for the update!

TwoD’s picture

Issue summary: View changes

Updated issue summary.