Opened 13 years ago
Last modified 13 years ago
#8473 confirmed Bug
JS error will cause CKEDITOR instances to not update their data to the iframe.
Reported by: | Michael Hopkins | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.0 |
Keywords: | Cc: | julianalucenaa@… |
Description
We are using mutliple CKEDITOR instances on one page. We hide and display them by killing sections of the page and later repopulating them. Because we kill the CKEDITOR HTML before the final getData processing was finished it left the CKEDITOR in a state where getData and setData would not update the iframe contents.
I have attached the file with the fix that we added.
In /_source/plugins/editingblock/plugin.js line 47. You get the data from the editor. If an exception happens in the getData code then isHandlingData doesn't get set to false. After that the iframe contents become impossible to update. This will effect all other CKEDITOR instances on the screen.
We just added an empty try catch so as to ensure that regardless of errors that happen isHandlingData will always get reset to false. Thus not effecting the usability of any other CKEDITOR instance.
We did the same at line 74.
To reproduce: In our case, we would call editor.destroy() and remove the ckeditor instance from the screen. Destroy would fire an event that would later try to access the contentDocument of the iframe. That would throw the error because it no longer existed on the screen. We also had an blur event set to the editor that would grab the data.
Anyway I hope this helps.
Attachments (3)
Change History (7)
Changed 13 years ago by
comment:1 Changed 13 years ago by
Status: | new → pending |
---|---|
Version: | 3.6.3 (SVN - trunk) |
Could I ask you first to provide a reproducible and reduced test case (html page) so that we could see the problem on our own?
Second: would it be possible to provide the fix you propose in a *.patch file?
Changed 13 years ago by
Attachment: | 0001-fix-for-8473.patch added |
---|
Changed 13 years ago by
Attachment: | reproduceCkEditorBug.html added |
---|
comment:2 Changed 13 years ago by
I added the test case.
Since the error i was having was caused by a race condition, reproducing it was successful only some of the time. Therefore I forced it by killing the innerHTML of the div and then calling getData() on the editor. So it reproduces everytime.
comment:3 Changed 13 years ago by
Status: | pending → confirmed |
---|---|
Version: | → 3.0 |
Message: $.contentWindow is null
URI: /3.6.2/ckeditor/_source/core/dom/element.js
Line: 1492
Reproducible from CKEditor 3.0
comment:4 Changed 13 years ago by
Cc: | julianalucenaa@… added |
---|
File that includes fix for this bug. editingblock plugin