Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13858 closed Bug (invalid)

Unhandled exception line 1935 ckeditor/core/selection.js when paste button pressed when run as an office addin.

Reported by: gemmell Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version:
Keywords: Cc:

Description

Steps to reproduce

Please note this exception occurs when I run ckeditor inside an "Apps for office" extension.

  1. Using Visual Studio open the project I have attached and run it.
  2. Click in the ckeditor that appears to the right.
  3. Type something.
  4. Select it and press copy it (ctrl+c).
  5. Press any of the paste buttons.

Expected result

I would expect it to paste.

Actual result

I get an unhandled exception.

Other details (browser, OS, CKEditor version, installed plugins)

This is running inside whatever browser "Apps for Office" or "Office Addin" uses.

Attachments (1)

CkEditorTest.zip (1.9 MB) - added by gemmell 8 years ago.
A default "Apps for office" plugin which loads CKEditor from cdn.

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by gemmell

Attachment: CkEditorTest.zip added

A default "Apps for office" plugin which loads CKEditor from cdn.

comment:1 Changed 8 years ago by gemmell

Note: You will need MS Office, I am running on windows 10, with MS Office 2013.

comment:2 Changed 8 years ago by gemmell

I believe it's using an embedded IE instance as when I crash out (different cause this time by the look of it) I get this:

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'createRange'
Unhandled exception at line 1935, column 6 in https://localhost:44300/ckeditor/core/selection.js
0x80004005 - JavaScript runtime error: Unspecified error.

The program '[5140] iexplore.exe' has exited with code 259 (0x103).
The program '[15948] iisexpress.exe' has exited with code 0 (0x0).
The program '[17596] WINWORD.EXE' has exited with code -1 (0xffffffff).

The version of iexplore installed on my machine is 11.0.10240.16431IS

Last edited 8 years ago by gemmell (previous) (diff)

comment:3 Changed 8 years ago by gemmell

However if I use http://ckeditor.com/demo using IE11 it is fine. Interesting.

comment:4 Changed 8 years ago by gemmell

Perhaps there is some clobbering going on between https://appsforoffice.microsoft.com/lib/1/hosted/office.js and cdn.ckeditor.com/4.5.4/standard/ckeditor.js

All my errors seem to be todo with selection or ranges...

comment:5 Changed 8 years ago by gemmell

Right clicking on any of those paste buttons actually works fine... now I am really confused...

Last edited 8 years ago by gemmell (previous) (diff)

comment:6 Changed 8 years ago by gemmell

My work around

                  // Work around for the paste crashes
                  editor_.on('paste', function (ev) {
                     console.log(ev);
                     deleteCkEditorSelection();
                     editor_.insertHtml(ev.data.dataValue);
                     ev.stop();
                  });

Does not work - the insertHtml() causes the same exception in the same spot.

comment:7 Changed 8 years ago by gemmell

Hrrm, from: https://msdn.microsoft.com/library/ms535869(v=vs.85).aspx

[selection is no longer supported. Starting with Internet Explorer 11, use getSelection. For info, see Compatibility changes.]

So I have a new theory that ckeditor is relying on some flag to detect the IE which is not being set when in the Office add in.

Yes, it's actually crashing in the else of a (isMSSelection) so perhaps if I keep digging i'll see where it's being set.

Hrrm. CKEDITOR.env.ie is true. CKEDITOR.env.cssClass is "cke_browser_ie cke_browser_ie11"

comment:8 Changed 8 years ago by gemmell

-		sel	{...}	[Object, Selection]
+		[Methods]	{...}	
		anchorNode	null	Null
		anchorOffset	0	Number
		focusNode	null	Null
		focusOffset	0	Number
		isCollapsed	true	Boolean
		rangeCount	0	Number

So selection looks fine when we call sel.addRange( nativeRange );

As does nativeRange Argh.

comment:9 Changed 8 years ago by gemmell

I have done a bit more digging. There doesn't seem to be a conflict with other js libs, if I point the plugin directly to the ckeditor demo page I see the same behaviour. So I will have to dig further.

Perhaps some flag is not being set when it should.

comment:10 Changed 8 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.5.4

This is running inside whatever browser "Apps for Office" or "Office Addin" uses.

@ gemmell I'm sorry but we don't support "Apps for Office" or browser specific to "Apps for Office".

comment:11 Changed 8 years ago by gemmell

Hi, it's actually using ie10 but it's obviously using it in some way or with some setting or perhaps even some injected js that means that it doesn't play nice with CKEditor. But I respect the decision to not address it, and I have switched to a different editor anyway.

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