Opened 13 years ago

Last modified 13 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@…,


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:


Interestingly, I cannot find any reference in the source to ''. It seems that this only exists in the ckeditor.js file.

Steps to reproduce:

  1. Start out on a page with two div elements with ids, 'editor1', 'editor2'.
  2. Use CKEDITOR.replace to replace 'editor1'
  3. Right click on the active editor to activate the context menu
  4. Left click on the active editor, not clicking on the menu items
  5. Repeat Step 3
  6. Repeat Step 4
  7. Use CKEDITOR.replace to replace 'editor2'

Tested in Chrome, IE8/9

Attachments (1)

ckeditor_7824.html (1.3 KB) - added by Michael Camden 13 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 13 years ago by Jakub Ś

Status: newpending

You it would be possible to provide us with a sample file?

Changed 13 years ago by Michael Camden

Attachment: ckeditor_7824.html added

comment:2 Changed 13 years ago by Michael Camden

Please see attached file. It also includes the steps to reproduce this bug.

comment:3 Changed 13 years ago by Frederico Caldeira Knabben

Cc: added
Keywords: error CKEDITOR.replace removed
Status: pendingconfirmed

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

comment:4 Changed 13 years ago by

This is duplicate of #7697

comment:5 in reply to:  4 Changed 13 years ago by Frederico Caldeira Knabben

Replying to

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 13 years ago by

The original 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:7 Changed 13 years ago by

Keywords: Confirmed added

We can reproduce this problem on trunk.

comment:8 Changed 13 years ago by Frederico Caldeira Knabben

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 13 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:


and lines 527, 528:

if ( attrs && attrs[ 'data-scaytid' ] )

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 ( No need to enable SCAYT to reproduce the problem.

Steps to reproduce:

  1. Open Replace DIV sample
  2. Double-click to enable the editor
  3. Switch to source mode
  4. Paste <span class="Apple-style-span">sample</span>
  5. Switch to WYSIWYG
  6. Double-click other DIV

Expected results: editor switched to other DIV

Real results: described error observed

comment:10 Changed 13 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:

comment:11 Changed 13 years ago by aaronransley

Disregard/delete this

Last edited 13 years ago by aaronransley (previous) (diff)
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