Opened 14 years ago
Last modified 14 years ago
#7824 confirmed Bug
Cannot call method 'split' of undefined on CKEDITOR.replace
Reported by: | Michael Camden | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.5.3 |
Keywords: | review? | Cc: | mcamden@…, WebSpellChecker.net |
Description
Our page has several divs that are placeholders for CKEDITOR instances. When a user clicks on one, it closes the active editor, and creates a new instance of CKEDITOR on the clicked div using CKEDITOR.replace. When you have an editor instance open, right click to open the context menu twice, and click on another div to open the editor, I get this error.
Cannot call method 'split' of undefined
This error only occurs when I am using ckeditor.js and not ckeditor_source.js. I've tracked the error down to line 23 of ckeditor.js. Here is a snippet of the issue:
q=function(x){var y=x.config.skin.split(','),z=y[0],A=a.getUrl(y[1]||'skins/'+z+'/');
Interestingly, I cannot find any reference in the source to 'config.skin.split'. It seems that this only exists in the ckeditor.js file.
Steps to reproduce:
- Start out on a page with two div elements with ids, 'editor1', 'editor2'.
- Use CKEDITOR.replace to replace 'editor1'
- Right click on the active editor to activate the context menu
- Left click on the active editor, not clicking on the menu items
- Repeat Step 3
- Repeat Step 4
- Use CKEDITOR.replace to replace 'editor2'
Tested in Chrome, IE8/9
Attachments (1)
Change History (12)
comment:1 Changed 14 years ago by
Status: | new → pending |
---|
Changed 14 years ago by
Attachment: | ckeditor_7824.html added |
---|
comment:2 Changed 14 years ago by
Please see attached file. It also includes the steps to reproduce this bug.
comment:3 Changed 14 years ago by
Cc: | WebSpellChecker.net added |
---|---|
Keywords: | error CKEDITOR.replace removed |
Status: | pending → confirmed |
I've confirmed the error in the provided TC with both FF and IE.
Just for reference, we're talking about line 115 of editor.js. For some unknown reason, editor.config gets mangled and becomes an invalid object.
To note that this happens only when enabling SCAYT, This tells me that this issue is much probably related to the load of SCAYT core from SpellChecker.net.
comment:5 Changed 14 years ago by
Replying to SpellChecker.net:
This is duplicate of #7697
This ticket cannot be a DUP of #7697 because that one is already closed and I can still confirm the issue on the current trunk.
comment:6 Changed 14 years ago by
The original patch - https://dev.ckeditor.com/attachment/ticket/7697/7697.patch have contained declaration of loop variable as 'var' in both loops. This prevents of mixing of variables names when minifying a version. But in changeset [6876] you've removed a "var" in the second loop by some reason. What we have observed is that problem is reproduced on 3.5.3 release available for download. If the same version will be built from sources in different environment the problem might not be reproduced. But with the "var" declaration of loop variable in the second loop the problem can not be reproduced in our environment.
comment:8 Changed 14 years ago by
Keywords: | Confirmed removed |
---|
If we add "var m" at line 671, it'll be a redeclaration of that variable, which is wrong (just like the previous patch).
Additionally, there is no justification for that "var" being the responsible for the fix. This is the minified version of that code (I've added one ENTER):
for(var M in w){delete t._.menuItems[M];delete t._.commands[M];} for(M in x){delete t._.menuItems[M];delete t._.commands[M];}
Something else must be wrong here.
comment:9 Changed 14 years ago by
While we were investigating the problem we have found issue with 'htmlFilter' and 'dataFilter' used in SCAYT plugin. If we comment out line 241:
delete element.name;
and lines 527, 528:
if ( attrs && attrs[ 'data-scaytid' ] ) delete element.name;
then the problem cannot be reproduced. We tried to review 'dataProcessor' code and found that there are similar filtering rules for
<span class="Apple-style-span">sample</span>
We tried to put such markup in to the editor and were able to reproduce the problem on nightly build (http://nightly.ckeditor.com/6956/_samples/). No need to enable SCAYT to reproduce the problem.
Steps to reproduce:
- Open Replace DIV sample http://nightly.ckeditor.com/6956/_samples/divreplace.html
- Double-click to enable the editor
- Switch to source mode
- Paste <span class="Apple-style-span">sample</span>
- Switch to WYSIWYG
- Double-click other DIV
Expected results: editor switched to other DIV
Real results: described error observed
comment:10 Changed 14 years ago by
Keywords: | review? added |
---|
Looks like this issue is fixed by #8000 .
We are not able to reproduce the issue on latest nightly build:
http://nightly.ckeditor.com/7045/_samples/divreplace.html
You it would be possible to provide us with a sample file?