Opened 9 years ago

Last modified 8 years ago

#7968 confirmed Bug

CKEditor 3.6 in IE7 - Unable to get value of the property 'getRanges': object is null or undefined

Reported by: Andrey Vaskovskiy Owned by:
Priority: Normal Milestone:
Component: UI : Enter Key Version: 3.5.3
Keywords: IE Cc:

Description

I found this issue after recent upgrade to the version 3.6.

Steps:

  • Set Focus to the CKEditor text area;
  • Click any other control you have on a page (like link or button);

See attached video (6-1-2011 6-56-55 PM.zip) and an ASP.NET sample application I used for testing (CKEditorTest.zip) for details.

Attachments (2)

6-1-2011 6-56-55 PM.zip (1.1 MB) - added by Andrey Vaskovskiy 9 years ago.
Video
CKEditorTest.zip (851.0 KB) - added by Andrey Vaskovskiy 9 years ago.
ASP.NET sample application

Download all attachments as: .zip

Change History (12)

Changed 9 years ago by Andrey Vaskovskiy

Attachment: 6-1-2011 6-56-55 PM.zip added

Video

Changed 9 years ago by Andrey Vaskovskiy

Attachment: CKEditorTest.zip added

ASP.NET sample application

comment:1 Changed 9 years ago by Jakub Ś

Component: GeneralServer : ASP.Net
Keywords: 'getRanges' removed

comment:2 Changed 9 years ago by Jakub Ś

Status: newpending

Going through files and searching for functions attached to buttons/links is rather hard, especially when you are not a .Net developer.

Could I ask you to provide me with those JS functions that are called when you click button ‘Add reply’ and link ‘Cancel’. At first it looks to me like some .NET integration problem but I want to make sure that this is not CKEditor problem itself.

Waiting for your reply.

comment:3 Changed 9 years ago by Andrey Vaskovskiy

There are no any JS functions attached to the click event (or any other JS event) of the button 'Add reply' or link 'Cancel'. I think that this is a CKEditor issue, because everything worked fine before upgrade. Most likely you can create any sample application with CKEditor 3.6 to reproduce the problem locally. But if you need assistance with my sample application I can schedule a GOTO meeting with you to help you with your locaL ASP.NET environment.

Regards, Andrey

comment:4 Changed 9 years ago by Jakub Ś

That won't be necessary. We have our .Net programmers.

What I meant is that I'm not a .Net programmer and before I start bothering others I have to make sure if this is not pure JS CKEditor problem. That is why I have asked you for these functions.

Now back to the bug:
If there are no JS functions attached to these buttons/links then please provide me with HTML you have used to create them (If this is not to much to ask).

I have tried to use normal HTML buttons but it did not give the results you had. So instead of wondering how did you achieve this, I think it’s easier to ask the author. It save us both some time.

comment:5 Changed 9 years ago by Andrey Vaskovskiy

The HTML used to create the ;ink and button are:

<p>

<input type="button" value="Add Reply" />&nbsp;&nbsp;or&nbsp;<a href="javascript:void(0);">Cancel</a>

</p>

The attached zip CKEditorTest.zip contains a file Default.aspx that shows how I'm creating those controls and the CKEditor itself. Let me know if this is not enough.

May be that's because I'm using IE9 in IE7 mode...like that's how we are testing our product in different IE browsers.

Regards, Andrey

comment:6 Changed 9 years ago by Andrey Vaskovskiy

I have tested the sample with clean IE7. It also gives a JS error.

comment:7 Changed 9 years ago by Jakub Ś

Component: Server : ASP.NetUI : Enter Key
Keywords: IE9 added; IE7 removed
Status: pendingconfirmed
Version: 3.63.5.3

The file Default.aspx was more than enough. Thank you.

A simplified TC:

  1. Prepare the HTML page with one editor
  2. Paste the following code
    <p>
       <input type="button" value="Add Reply" />&nbsp;&nbsp;or&nbsp;<a href="javascript:void(0);">Cancel</a>
    </p> 
    
    var ckeditor = CKEDITOR.replace('editor1',
    {
    	enterMode: CKEDITOR.ENTER_DIV
    });	
    
  3. Place the cursor inside textarea
  4. Click on one of the buttons.

Result:JS error is thrown
Message: Can’t get property „getRanges”: object is either empty or undefined
Line: 818
URI: /ckeditor/_source/plugins/wysiwygarea/plugin.js

I have been able to reproduce it on IE9 in IE7 mode (No luck with pure IE7) from CKEditor 3.5.3 rev [6486].

comment:8 Changed 8 years ago by motioncloud

I'm having the same issue on IE9 (it was not in IE7 mode) in my case.

comment:9 in reply to:  7 Changed 8 years ago by jero

Replying to j.swiderski:

A simplified TC:

  1. Prepare the HTML page with one editor
  2. Paste the following code
    <p>
       <input type="button" value="Add Reply" />&nbsp;&nbsp;or&nbsp;<a href="javascript:void(0);">Cancel</a>
    </p> 
    
    var ckeditor = CKEDITOR.replace('editor1',
    {
    	enterMode: CKEDITOR.ENTER_DIV
    });	
    
  3. Place the cursor inside textarea
  4. Click on one of the buttons.

I have been able to reproduce it on IE9 in IE7 mode (No luck with pure IE7) from CKEditor 3.5.3 rev [6486].

I have been able to repro it in IE7. From the above example, DO NOT do step 3. If the editor never actually gets the focus then you will get the error.

I have done some investigation on this. (take what I say with a grain of salt because I am not an expert on ckeditor).

There are two things I notice. Firstly the selectionchanged event handler where the bug is looks like it might be a hangover from FCK. It is trying to stop a empty para if the body is empty but CKEDITOR.config.autoParagraph and CKEDITOR.config.fillEmptyBlocks seem to handle this now.

Secondly and more importantly, CKEDITOR.editor.getSelection() which is the call that actually causes the exception, can return null. But in all its uses I can see in the source code, there is never any checking of whether the selection is null. It is assumed that it will always return a valid selection.

comment:10 Changed 8 years ago by Jakub Ś

Keywords: IE added; IE9 removed

Yes - without step 3 issue is also reproducible in IE7

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy