Opened 15 years ago

Last modified 12 years ago

#4251 confirmed Bug

Adding wrong plugin doesn't give proper warning

Reported by: Alfonso Martínez de Lizarrondo Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description

Modify a sample so it tries to load a non-existing plugin:

var editor = CKEDITOR.replace( 'editor1',
	{
		extraPlugins : 'World'
	});

Now loading the page in IE gives an error message without any clue about the problem.
It can be improved this way:

  • _source/core/plugins.js

     
    5656                                                        for ( pluginName in allPlugins )
    5757                                                        {
    5858                                                                plugin = allPlugins[ pluginName ];
     59                                                                if ( !plugin )
     60                                                                {
     61                                                                        alert( 'Plugin "' + pluginName + '" not loaded.' ) ;
     62                                                                        continue ;
     63                                                                }
    5964                                                                if ( plugin.onLoad && !plugin.onLoad._called )
    6065                                                                {
    6166                                                                        plugin.onLoad();

For other browsers, it throws an exception in core\scriptmanager.js:

				if ( failed.length )
				{
					throw '[CKEDITOR.resourceManager.load] Resource name "' + urlsNames[ failed[ 0 ] ].join( ',' )
						+ '" was not found at "' + failed[ 0 ] + '".';
				}

But that's shown only in the error console, it will be more useful if the message is shown in an alert.

Change History (1)

comment:1 Changed 12 years ago by Jakub Ś

Status: newconfirmed
Version: SVN (CKEditor) - OLD3.0

Agreed that message in IE ("can't get property onLoad. Object is either empty or undefined" ) is not telling anything to the developer but I'm not sure if alerts should replace console.logs.

These messages are only useful for developers and when someone is developing in CKEditor he should be familiar with console. Such extra alert when popping out to regular user might perhaps be considered more annoying (user has to make extra click and when he is checking site every 5 min than he could get really pissed).
On the other hand when such alert pops out user can make a screenshot and send it to his support team – it is better than pressing F12 and going to console to get the message.

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