Ticket #5552 (review_failed Bug)

Opened 5 years ago

Last modified 3 years ago

Dialog doesn't execute 'commit' and 'setup' method of element when element miss 'id' property.

Reported by: m.nguyen Owned by: m.nguyen
Priority: Normal Milestone:
Component: General Version: SVN (CKEditor) - OLD
Keywords: Cc:

Description

Steps to reproduce

Create new dialog without set id attribute for element or open one old dialog and remove id attribute of element:

CKEDITOR.dialog.add( 'bulletedListStyle', function( editor )
	{
		return {
			title : editor.lang.list.numberedTitle,
			minWidth : 300,
			minHeight : 50,
			contents :
			[
				{
					elements :
					[
						{
							type : 'hbox',
							widths : [ '25%', '75%' ],
							children :
							[
								{
									label: editor.lang.list.start,
									type: 'text',
									setup : function( element )
									{
										var value = element.getAttribute( 'start' ) || 1;
										value && this.setValue( value );
									},
									commit : function( element )
									{
										element.setAttribute( 'start', this.getValue() );
									}
								},
								{
									type : 'select',
									label : editor.lang.list.type,
									width: '100%',
									items :
									[
										[ editor.lang.list.style_1 , '1' ],
										[ editor.lang.list.style_a , 'a' ],
										[ editor.lang.list.style_A , 'A' ],
										[ editor.lang.list.style_i , 'i' ],
										[ editor.lang.list.style_I , 'I' ]
									],
									setup : function( element )
									{
										var value = element.getAttribute( 'type' ) || '1';
										this.setValue( value );
									},
									commit : function( element )
									{
										element.setAttribute( 'type', this.getValue() );
									}
								}
							]
						}
					]
				}
			],
			onShow: function() 
			{
				var editor = this.getParentEditor(),
					element = getListElement( editor, 'ol' );

				element && this.setupContent( element );
			},
			onOk: function()
			{
				var editor = this.getParentEditor(),
					element = getListElement( editor, 'ol' );
				
				element && this.commitContent( element );
			}
		}
	});
  • Expected: all 'commit' and 'setup' method of element will execute
  • Result: only the last element have that behavior

Attachments

5552.patch (820 bytes) - added by m.nguyen 5 years ago.

Change History

Changed 5 years ago by m.nguyen

comment:1 Changed 5 years ago by m.nguyen

  • Keywords Review? added
  • Status changed from new to assigned
  • Owner set to m.nguyen

When user doesn't add 'id' attributes, the id of 'element' will be 'undefined'. This patch automatically add dynamic 'id' when user didn't add.

comment:2 Changed 4 years ago by fredck

  • Milestone CKEditor 3.x deleted

Milestone CKEditor 3.x deleted

comment:3 Changed 3 years ago by fredck

  • Status changed from review to review_failed

The 'commit' and 'setup' and setup function have nothing to do with the id.

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