Opened 10 years ago
Closed 10 years ago
#12390 closed Bug (expired)
When an asynchronous post back happens really quickly after loading a CKEditor, a script error occurs
Reported by: | infoland | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.4.4 |
Keywords: | Cc: |
Description
When an asynchronous post back happens immediately after loading a CKEditor, a script error occurs around this piece of code:
a.readOnly=!(!c.readOnly&&!(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled"):a.element.isReadOnly():a.elementMode== CKEDITOR.ELEMENT_MODE_REPLACE&&a.element.hasAttribute("disabled")
This is because a.element is <null>, but this is not checked before it is used.
Attachments (2)
Change History (5)
Changed 10 years ago by
Attachment: | CKEditorTest.zip added |
---|
Changed 10 years ago by
Attachment: | PrtScr capture_4.png added |
---|
Screen capture of the debugger where the error occurred
comment:1 Changed 10 years ago by
I'm encountering a very similar error here:
CKEDITOR.plugins.add("save",{init:function(a){if(a.element!=null)a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(a.addCommand("save",b).modes={wysiwyg:!!a.element.$.form
}
a.element is null sometimes and not checked.
comment:2 Changed 10 years ago by
Status: | new → pending |
---|
Hi,
I have checked your sample project and think it is happening due to some CKEditor related action being called too fast.
In you project I have seen page being reloaded vary fast 10 times or more in 200 milliseconds intervals. I haven’t seen any editor code (most likely it is inside DLL) but my guess is that whole this report is a duplicate of http://dev.ckeditor.com/ticket/11502#comment:8.
When page is being relaoded 5 times in one second it is possible that something may break. If this was only for test then in order to avoid such errors you can:
- use
editor.status
andeditable.status
- use callbacks for setData if this error occurs when setting data - http://dev.ckeditor.com/ticket/10501#comment:10
- reload page after instanceReady or instanceDestroyd is fired, http://docs.ckeditor.com/#!/api/CKEDITOR-event-instanceDestroyed, http://docs.ckeditor.com/#!/api/CKEDITOR-event-instanceReady.
CKEditor is huge application and, as explained in ticket #11502, it may happen that in some cases some methods are not loaded yet but they are called. In such cases I think the best approach is not forcing actions on CKEditor but cooperating with it. IMHO your code could wait these extra few milliseconds and e.g. setData or destroy editor once it is loaded.
@infoland are these the issues you were getting?
comment:3 Changed 10 years ago by
Resolution: | → expired |
---|---|
Status: | pending → closed |
Test ASP.Net project which recreates the problem