Opened 15 years ago

Closed 15 years ago

#4525 closed Bug (invalid)

[IE6] setData problem with custom plugin

Reported by: Damian Owned by:
Priority: Normal Milestone: CKEditor 3.1
Component: General Version:
Keywords: IBM Cc:


A simple plugin calling setData() on the editor in the exec() method falls over in IE6.

The plugin is invoked by a command on the toolbar.

Plugin exec() definition:


When using a Microsoft debugger the error thrown is:
Error: 'this.$.innerHtml' is null or not an object.
Line 331 in element.js

I've traced this down to what I think is the call to getSnapshotData() in the wysiwygarea which ultimately calls getHtml() on the element, after setting the data.

Only an issue with IE6.

Change History (3)

comment:1 Changed 15 years ago by Garry Yao

Keywords: Pending added

I don't have the bug with the setData call in 'api' sample file, could you provide a reduced plugin for reproducing?

comment:2 Changed 15 years ago by Damian

Here is the full plugin.js file, which resides in "plugins/testsetdata":

CKEDITOR.plugins.add( 'testsetdata',
	init : function( editor )
		editor.addCommand( 'testsetdata', CKEDITOR.plugins.testsetdata );
		editor.ui.addButton( 'testsetdata',
				label : 'TestSetData',
				command : 'testsetdata'
} );

CKEDITOR.plugins.testsetdata =

And here is the config.js

	config.toolbar=[[ 'Source', '-', 'Bold', 'Italic','testsetdata' ]];

Those are the only changes to a default build.

comment:3 Changed 15 years ago by Garry Yao

Keywords: Pending removed
Resolution: invalid
Status: newclosed

It's not a bug, coz 'editor.setData' should be declared as a 'asynchronous' command and you need to manually fire the after command event:

	async : true,
	exec : function( editor )
		var command = this;
		editor.setData( '<b>Test</b>', function()
		{ 'afterCommandExec',
				name: 'testsetdata',
				command: command
			} );

Sorry for the obscure but we should document this special case very soon.

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