Redactor not saving complete deletions

Most of the apps today use WYSIWYG editors to manage editable content/text and we have some highly customizable options available such as TinyMCE( or CKEditor(

Another great option is Redactor( if you want minimalistic UI with extremely simple API. It is simple to implement and comes readily compatible with jQuery. So all you have to do is make a simple call as :

I have been using this great plugin for the past few months and i did not have any issues whatsoever. In fact i loved it’s autosave feature making it simple to save content at a regular interval or on content change.<\p>

But just a couple days ago i noticed an issue with autosave where it won’t autosave when we remove all the content. To resolve this i looked into the redactor.js file and found that it had a condition put in place which was something like this :

So whenever it found the content area as empty it would just return instead of running ajax calls. So all i had to do was to comment out this line of code and it started saving empty values.

Now, it might have been updated in the 10.x so please update your plugin if you want to avoid this temporary fix.



Application developer, movie buff, occasional reader and a huge Manchester United fan.