Opened 8 years ago

Closed 8 years ago

#4764 closed Bug (fixed)

Exception message in .appendTo() always shows null

Reported by: Alfonso Martínez de Lizarrondo Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.1
Component: General Version: 3.0.1
Keywords: Review+ Cc:

Description

If the CKEDITOR.appendTo() method is called with an invalid id the exception generated will always show "[CKEDITOR.editor.appendTo] The element with id "null" was not found" instead of the proper id.

This code fixes it (still searching for proper SVN cliente for Mac):

	CKEDITOR.editor.appendTo = function( elementOrId, config )
	{
		var element = elementOrId;
		if ( typeof element != 'object' )
		{
			element = document.getElementById( elementOrId );

			if ( !element )
				throw '[CKEDITOR.editor.appendTo] The element with id "' + elementOrId + '" was not found.';
		}

		// Create the editor instance.
		return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO );
	};

Attachments (1)

4764.patch (948 bytes) - added by Garry Yao 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by Garry Yao

Attachment: 4764.patch added

comment:1 Changed 8 years ago by Garry Yao

Keywords: Review? added; HasPatch removed
Milestone: CKEditor 3.1
Owner: set to Garry Yao
Status: newassigned

Targeting it to 3.1 since it's an frequent exception facing developers.

comment:2 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:3 Changed 8 years ago by Garry Yao

Fixed with [4667].
Thanks for Alfonsoml.

comment:4 Changed 8 years ago by Garry Yao

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