Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9027 closed Bug (wontfix)

Error when removing the "advanced" tab from the "link" dialog

Reported by: ericl Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Using the code below in a custom config file, I get a javascript error when I click the link icon and it brings up the link dialog with the advanced tab removed. The error says "Uncaught TypeError: Cannot call method 'setValue' of undefined ckeditor.js:149" in Chrome. If I comment out line 10 in the code below (the line that removes the advanced tab), then the error goes away.

Using similar code to remove the advanced tabs from the image, flash and table dialogs works fine. Is there something else I need to do when trying to remove the advanced tab from the link dialog?

Code:

CKEDITOR.on( 'dialogDefinition', function( ev )
	{
		// Take the dialog name and its definition from the event
		// data.
		var dialogName = ev.data.name;
		var dialogDefinition = ev.data.definition;

		if (dialogName == 'link')
		{
			dialogDefinition.removeContents( 'advanced' );

			dialogDefinition.onFocus = function()
			{
				var urlField = this.getContentElement( 'info', 'url' );
					urlField.select();
				var targetField = this.getContentElement('target', 'linkTargetType');
					targetField.remove(6);
					targetField.remove(4);
					targetField.remove(2);
					targetField.remove(1);
			};
		}
	});

Change History (5)

comment:1 Changed 7 years ago by Jakub Ś

Keywords: advanced tab link dialog error removed
Status: newpending

I have tried your code and it works well in default CKEditor.

This is rather some other custom change that you have made (maybe you have removed something) in CKEditor that is causing it. Could you check and leave me a comment.

To test this particular problem download default CKEditor, insert your code in config.js file and see if you are getting any errors. If not that problem lies somewhere in your changed code.

comment:2 Changed 7 years ago by Wiktor Walc

Version: 3.6.3

comment:3 Changed 7 years ago by ericl

Resolution: wontfix
Status: pendingclosed

comment:4 Changed 7 years ago by Jakub Ś

Could you tell us why have you closed this issue as won't fix?
Have you found a solution to your problem? Could you leave a comment telling us what it was?

comment:5 Changed 7 years ago by ericl

Sorry about that, I wasn't able to fix it. I'm not sure if this was an issue with CKEditor itself or the custom setup I have on my site using the WYGWAM plugin for ExpressionEngine, which in turn utilizes CKEditor. As you suggested, it probably resulted from a customization that I or the other developers made in their plugin. Anyway, thanks for your suggestion! If I end up finding out what it was, I'll update this. For now, I'm just leaving the Link dialog's advanced tab alone.

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