All text written in rich text editor mode (WYSIWYG) disappears when toggling to plain text editor mode. Text written in plain text editor mode is shown in rich text editor mode though.
I tested this on a clean Drupal 7 installation with only ckeditor module installed.
I have created a fix to this bug but I am not sure if it is the best place to add it.
On row 121 in includes/ckeditor.utils.js in the ckeditorOff function I added the following line of code:
$("#" + textarea_id).val(CKEDITOR.instances[textarea_id].getData());
Another place to add this piece of code (with some modification) is in the ckeditorToggle function between row 15 and 16, before Drupal.ckeditorOff is called.
What do you think?
Comments
Comment #1
marhak commentedI have not received any comments about this so I write a litte more :) For me this is a quite serious bug but maybe I didn't explain the problem good enough or maybe it has already been solved in an other issue (I searched but didn't find any though).
I'll try to explain it again.
The problem occurs when I am adding content in the CKEditor and then toggle to plain text mode. All content I have been adding so far is then removed (what should happen is that the content is shown with its markup). If I toggle back it is still missing. The solution I posted in the issue report solves this.
Note however that content that is added in plain text mode is NOT deleted when toggling from plain text to CKEditor mode.
Comment #2
tangamampilia commentedThanks! Your patch partially fixs the problem.
Thanks again!
Comment #3
dczepierga commentedI make a little fix and commit it to GIT. Fix related with #1102824: CKEDITOR loses all text when uploading image or file via field api
Please check the latest dev release and let me know if you notice any poblems with it. Remember to clear Drupal cache and browsers cache before testing.
Greetings
Comment #4
mkesicki commented@dczepierga I have still this issue, but fix added by @marhak resolve problem.
Comment #5
dczepierga commentedOk i add @marhak fix and commit it to GIT.
Please check the latest dev release and let me know if you notice any poblems with it. Remember to clear Drupal cache and browsers cache before testing.
Greetings
Comment #6
mkesicki commentedHi, @dczepierga now it works.
Comment #7
dczepierga commentedComment #8
dczepierga commented