Opened 15 years ago

Last modified 13 years ago

#5552 review_failed Bug

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

Reported by: Minh Nguyen Owned by: Minh 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 (1)

5552.patch (820 bytes) - added by Minh Nguyen 15 years ago.

Download all attachments as: .zip

Change History (4)

Changed 15 years ago by Minh Nguyen

Attachment: 5552.patch added

comment:1 Changed 15 years ago by Minh Nguyen

Keywords: Review? added
Owner: set to Minh Nguyen
Status: newassigned

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 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:3 Changed 13 years ago by Frederico Caldeira Knabben

Status: reviewreview_failed

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

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