Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9951 closed Bug (invalid)

Uncaught TypeError: Cannot call method 'unselectable' of null

Reported by: Mutaz Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

I'm getting the following error and I don't know how to deal with it. It just freezes the editor and stops it from initialising!

Uncaught TypeError: Cannot call method 'unselectable' of null new (2):265
a new (2):265
(anonymous function) new (2):262
h new (1):20
CKEDITOR.event.CKEDITOR.event.fire new (1):22
CKEDITOR.editor.CKEDITOR.editor.fire new (1):23
CKEDITOR.event.CKEDITOR.event.fireOnce new (1):22
CKEDITOR.editor.CKEDITOR.editor.fireOnce new (1):23
(anonymous function) new (2):203
n new (2):184
CKEDITOR.scriptLoader.load new (2):184
(anonymous function) new (2):202
(anonymous function) new (2):191
(anonymous function) new (2):189
n new (2):184
CKEDITOR.scriptLoader.load new (2):184
CKEDITOR.resourceManager.load new (2):188
g new (2):190
(anonymous function) new (2):191
h new (2):201
(anonymous function) new (2):200
CKEDITOR.lang.load new (2):182
k new (2):199
(anonymous function) new (2):199
a new (2):385
CKEDITOR.skin.loadPart new (2):387
g new (2):199
(anonymous function) new (2):199
h new (1):20
CKEDITOR.event.CKEDITOR.event.fire new (1):22
CKEDITOR.editor.CKEDITOR.editor.fire new (1):23
CKEDITOR.event.CKEDITOR.event.fireOnce new (1):22
CKEDITOR.editor.CKEDITOR.editor.fireOnce new (1):23
d new (2):199
(anonymous function) new (2):196
(anonymous function)

Change History (5)

comment:1 Changed 12 years ago by Jakub Ś

Status: newpending

CKEditor works out of the box thus I doubt this is a bug.

Could you provide more information here?

  1. Which editor do you use standard JS or some integration?
  2. Which version of editor do you use?
  3. What are steps that need to be performed to get this issue?
  4. Does it happen in standalone editor or only when integrated into your app?

comment:2 Changed 12 years ago by Mutaz

I got to know the cause of this error: My application is a single page one. I have the CKEDITOR in the new form for the post, when the user hits "save" button, it redirects the browser (client side redirection) to the edit form which also has CKEDITOR on the same HTML element (also same ID) of the new form. It seems that the instance of CKEDITOR in the new form doesn't get destroyed and trying to initialise the editor again on the same field generates that error. The version of CKEDITOR I'm using is 4.0.1 If this is considered as a bug, fixing it could be by avoiding throwing and error when initialising CKEDITOR on the same field again. Anyway, I fixed it by destroying the instance and initialising it again when the redirect happens.

More info: It is standard JS and a standalone editor.

Thanks for the reply.

comment:3 Changed 12 years ago by Jakub Ś

Resolution: invalid
Status: pendingclosed

Anyway, I fixed it by destroying the instance and initialising it again when the redirect happens.

This is the way to do it properly. When you want to create new instance on same HTML element you have to destroy old one first.

comment:4 Changed 11 years ago by Jeremiah Johnson

I see that this is closed but I did just want to comment that I get this in a single-page app even though I'm not attempting to re-create another editor. What I'm seeing is that CKEDITOR.replace is invoked twice (because I have 2 text areas to replace) and function b(a) is invoked 3 times; the third time it is invoked I get the error (not surprisingly). I don't yet understand why it is invoked 3 times - perhaps it is something I've done in my app - but it is interesting to me that CKEDITOR.replace is only invoked when and as expected.

comment:5 Changed 11 years ago by Jakub Ś

Please provide this sample webapp or simply have a look at AJAX sample in default editor to see how it should be handled.

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