Opened 7 years ago

Closed 7 years ago

#4764 closed Bug (fixed)

Exception message in .appendTo() always shows null

Reported by: alfonsoml Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.1
Component: General Version: 3.0.1
Keywords: Review+ Cc:


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 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by garry.yao

comment:1 Changed 7 years ago by garry.yao

  • Keywords Review? added; HasPatch removed
  • Milestone set to CKEditor 3.1
  • Owner set to garry.yao
  • Status changed from new to assigned

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

comment:2 Changed 7 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:3 Changed 7 years ago by garry.yao

Fixed with [4667].
Thanks for Alfonsoml.

comment:4 Changed 7 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy