Ticket #4473 (closed Bug: fixed)

Opened 6 months ago

Last modified 4 months ago

editor.dataProcessor.dataFilter.addRules() doesnt work for same multiple elements

Reported by: dmitryx Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.1
Component: Core : Output Data Version: 3.0
Keywords: Confirmed Review+ Cc:

Description

I tried to create custom plugin, that deals with div fake object, so i added some code to parse blocks presented as fake object correctly:

afterInit : function( editor )
		{
			var dataProcessor = editor.dataProcessor,
				dataFilter = dataProcessor && dataProcessor.dataFilter;
			if ( dataFilter )
			{
				dataFilter.addRules(
				{
					elements :
					{
						div : function( element )
						{
...
							return editor.createFakeParserElement( element, 'cke_myclass', 'div', false );
						}
					}
				});
			}
		},

		requires : [ 'fakeobjects' ]

The problem about it, is that exception of undefined variable is thrown when editor loads. Apparently, it only happens if pagebreak plugin is active (so another rule for DIV element is registered). But if you disable pagebreak plugin: config.removePlugins = 'pagebreak', it works just fine.

Attachments

4473.patch Download (466 bytes) - added by garry.yao 4 months ago.

Change History

Changed 4 months ago by garry.yao

  • keywords Confirmed added
  • owner set to garry.yao
  • status changed from new to assigned
  • component changed from General to Core : Output Data
  • milestone changed from CKEditor 3.x to CKEditor 3.1

Nice catch though the fix has been proposed at multiple other tickets, desire to give a separate fix on this ticket.

Changed 4 months ago by garry.yao

Changed 4 months ago by garry.yao

  • keywords Review? added

Changed 4 months ago by garry.yao

Related to #4067, #4548, #3401.

Changed 4 months ago by fredck

  • keywords Review+ added; Review? removed

Changed 4 months ago by garry.yao

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with [4491].

Note: See TracTickets for help on using tickets.