Opened 10 years ago

Closed 10 years ago

#2923 closed Bug (fixed)

"CKEDITOR is not defined" on page reload when editor focused.

Reported by: Garry Yao Owned by: Frederico Caldeira Knabben
Priority: Normal Milestone: CKEditor 3.0
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Firefox Review+ Cc:

Description (last modified by Garry Yao)

This bug is found to be due to reload the page with focus on wysiwyg mode, cause a javascript error as titled in FF.

Attachments (4)

2923.patch (457 bytes) - added by Artur Formella 10 years ago.
2923_2.patch (977 bytes) - added by Artur Formella 10 years ago.
2923_3.patch (648 bytes) - added by Frederico Caldeira Knabben 10 years ago.
2923_4.patch (663 bytes) - added by Frederico Caldeira Knabben 10 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 10 years ago by Garry Yao

Description: modified (diff)
Keywords: Firefox added

Changed 10 years ago by Artur Formella

Attachment: 2923.patch added

comment:2 Changed 10 years ago by Artur Formella

Keywords: Review? added

comment:3 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

The correct way to check for a global variable existence is by using the "window" object, not "document". Don't know how it worked for you, but theoretically it shouldn't.

Please also add a comment including this ticket number, so we can understand why we are doing that in the future.

Changed 10 years ago by Artur Formella

Attachment: 2923_2.patch added

comment:4 Changed 10 years ago by Artur Formella

Keywords: Review? added; Review- removed

comment:5 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed
Owner: set to Frederico Caldeira Knabben
Status: newassigned

The first patch was much better than this new one. You should have only changed "document" to "window", as I've described. I can't understand the changes on "editor_basic.js" also.

I'll be attaching a new patch for it, as this one is quite an annoying bug.

Changed 10 years ago by Frederico Caldeira Knabben

Attachment: 2923_3.patch added

comment:6 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Review? added; Review- removed

comment:7 Changed 10 years ago by Garry Yao

It's actually a very edge bug for FF, the native event which caused the error is found to be keyup, which only happened when reloading page with key shortcut like F5 and Ctrl-R, it could be identified with the following modification to the same patching position as in 2923_3.patch.

			if ( typeof CKEDITOR != 'undefined' ) 
				domObject.fire( eventName, new CKEDITOR.dom.event( domEvent ) );
			else 
				throw new Error( domEvent.type );

So at the point of this error, the whole JavaScript global context which is window doesn't present at all, we need to make the sniffer happened at JavaScript Core level instead of the host environment perhaps.

comment:8 Changed 10 years ago by Garry Yao

Keywords: Review- added; Review? removed

Changed 10 years ago by Frederico Caldeira Knabben

Attachment: 2923_4.patch added

comment:9 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Review? added; Review- removed

comment:10 Changed 10 years ago by Garry Yao

Keywords: Review+ added; Review? removed

comment:11 Changed 10 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed

Fixed with [3211].

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