Opened 10 years ago

Last modified 10 years ago

#11770 confirmed Bug

Destroying an editor while a widget is selected causes JS error in IE

Reported by: ross pace Owned by:
Priority: Normal Milestone:
Component: UI : Widgets Version: 4.3
Keywords: Cc:


I am using IE 11 and an inline editor. If you add a widget, such as the demo simplebox widget, and while it is selected you destroy the editor (such as the user clicking a cancel button that removes the editor function) there is a JS error.

The JS error occurs while trying to remove expand attributes. In plugin.js on line 211 it calls contents.replace( /\s+data-cke-expando=".*?"/g, ) but in this situation contents is a Boolean value equal to true so it throws the exception that there is no replace function for that value.

It appears that the code expects editor the getSnapshot to return a string but a Boolean is being returned instead. Looking at event.js it appears true is returned when an event call returns undefined.

Change History (3)

comment:1 Changed 10 years ago by ross pace


comment:2 Changed 10 years ago by Piotrek Koszuliński

Interesting case. I can confirm it on IE11, couldn't on Chrome.


  1. open /plugins/image2/dev/image2.html
  2. exec: setTimeout( function() { CKEDITOR.instances.editor2.destroy() }, 5000 );
  3. focus any widget in the second editor (the inline one).

The call stack is pretty complex though. Perhaps editor tries to unlock selection after the editor is already dead.

comment:3 Changed 10 years ago by Piotrek Koszuliński

Status: newconfirmed
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy