Hello
I have this problem... TinyMCE dissapear when I press "Preview", but if I disable "Ajax plugin - wysiwyg", all works perfectly on IE, but with Firefox or Chrome TinyMCE editor cannot save any changes...

Thanks!

Comments

fizk’s picture

Same problem!

Subscribing

fizk’s picture

Actually.......seems like disabling Ajax WYSIWYG plugin did the trick :)

Only tested on Firefox 3

nileshgr’s picture

Same here on FF3.

darthf1’s picture

Title: Ajax, WYSIWYG API, TinyMCE editor disappear after preview » Ajax, WYSIWYG API, TinyMCE, CKeditor disappear after preview

Im using CKeditor and getting this bug too. I can click "Disable WYSIWYG-editor" and then "Enable WYSIWYG editor" and all works fine again.

detonator94’s picture

When enabled ajax for comments and use ckeditor I had message «Comment is required» when click on submit button in comment form. ajax for fckeditor module isn`t work with ckeditor. What should I do to use ckeditor with ajax module correctly?

nileshgr’s picture

I switched to BBCode :)
Using BBCode also enables the use of geshiflter.

fizk’s picture

I'm having this problem again :(

wmostrey’s picture

This is still happening (and I need the "Ajax plugin - wysiwyg" module).

wmostrey’s picture

You can try solving it with JS Alter, jQuery Form Update and jQuery AOP. These modules require no configuration: just enable them to fix the problems.

Apfel007’s picture

this don't work for me

MauPalantir’s picture

This happened to me too while testing the validation & error messages.
Looking into the code, I saw that the wysiwyg plugin only detaches the editor when the form is submitted and does nothing afterwards, regardless of which happens to the form. When it is just submitted then everything is OK but if the form returns with a preview or an error then the editor still remains detached.

The full wysiwyg plugin is as follows: (file: ajax_wyswyg.js)

Drupal.Ajax.plugins.wysiwyg = function(hook, args) {
  var p, e;
  if (hook === 'submit') {
    if (Drupal.wysiwyg && Drupal.wysiwygDetach) {
      for (w in Drupal.wysiwyg.instances) {
        p = Drupal.wysiwyg.instances[w];
        e = $('#' + p.field);
        Drupal.wysiwygDetach(e[0], p);
      }
    }
  }
  return true;
}

Then, I added a second test before the final "return true;" statement so the function responds to the hook 'message' too:

...
  if (hook === 'message') {
    if (Drupal.wysiwyg && Drupal.wysiwygAttach) {
      for (w in Drupal.wysiwyg.instances) {
        p = Drupal.wysiwyg.instances[w];
        e = $('#' + p.field);
        Drupal.wysiwygAttach(e[0], p);
      }
    }
  }
...

So if any "message" (preview, error, success, warning) comes back the plugin re-enables the editor with wysiwygAttach().

brendoncrawford’s picture

Status: Active » Needs work
brendoncrawford’s picture

Status: Needs work » Fixed

Fixed, thanks to @cluke009's contribution at https://github.com/brendoncrawford/drupal-ajax/pull/2

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

laxman.ghavte’s picture

Issue summary: View changes

Fixed issue by using javascript code

removed old CKEDITOR instances for the text area.

$(document).ajaxComplete(function() {
  if(CKEDITOR.instances["edit-message"]) {
    delete CKEDITOR.instances["edit-message"];
    $('#edit-message').ckeditor();
}
});

where 'edit-message' was id of textarea.