When going to my front page and use the "edit box" link (contextual links) to edit it. It opens up in a modal. I can alter the text and save.
The second time I try to do this, the box doesn't open in a modal, but it is loaded inline. And I get an error in the ckeditor.js. (Uncaught TypeError: Cannot read property 'document' of null).
From the third time on and every attempt after that to edit the box, it opens in a modal, but no text is loaded in the body field. When saving, the empty body field gets saved. This is very annoying. But I can't find a solution for the moment.
Any idea?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

phoenix’s picture

I tried it again. And this time I got pointed to Drupal.behaviors.textarea.
Check it out here:

Screen Shot 2012-11-19 at 12.24.10.png

mariancalinro’s picture

Assigned: Unassigned » mariancalinro
Status: Active » Needs review
FileSize
964 bytes

I had the same problem using boxes with CKEDITOR.

The CKEDITOR instances are not destroyed when the dialog is closed, so when then next dialog opens, CKEDITOR tries to destroy the existing instances that will be replaced. As the nodes ar no longer in the DOM, the destroy operation will fail.

The fix was to search for CKEDITOR instances inside the dialog when closing it, and to destroy them before the dialog and the content is destroyed.

Patch attached, please test and review.

mariancalinro’s picture

Issue summary: View changes

Updated issue summary.

ZoeN’s picture

Issue summary: View changes

I have this problem. The patch doesn't fix it, for me, alas.

tylersamples’s picture

The patched worked for me.

mariancalinro’s picture

Assigned: mariancalinro » Unassigned

Unassigning myself, this was by mistake.