WYSIWYG error when using managed_file and AJAX I have a form that has both a managed_file element and a text_format element. Both are encapsulated in a wrapper div (using #prefix and #suffix). On submit, an AJAX callback is executed and both elements are populated with data.

However, when the form is rebuilt, the WYSIWYG editor disappears. The following error is displayed in the javascript console of my browser: Uncaught [CKEDITOR.editor] The instance "edit-text-value" already exists.

When I remove the managed_file element, the form works as it is supposed to. It probably has something to do with the Drupal behaviours not being executed properly (managed_file widget?), not removing the editor instance.
go around ckeditor.utils.js, the thing is that at various events ckeditorOff() function is called which causes ckeditor to go off, i just commented out a destroy call in the ckeditorOff() method and the RTE disappearance issue got solved