Link to home
Start Free TrialLog in
Avatar of Colin Brazier
Colin BrazierFlag for United Kingdom of Great Britain and Northern Ireland

asked on

CKEditor - will not function

Hi,

I have custom-built a standard version of CKeditor with plugins, downloaded and installed.

When I try to use it, it doesn't work; the editor does not show at all.  The console log is attached.

This is my call...

<script type="text/javascript">
	CKEDITOR.replace( 'txtBody',
    {
        /*extraplugins: 'youtube',*/
		//uiColor : '#F90',
        uiColor : '#FC0',
		//toolbar : 'Basic',
		//toolbar : 'FOBG',
		on :
		{
			instanceReady : function( ev )
			{
				this.dataProcessor.writer.setRules( 'p',
					{
						indent : false,
						breakBeforeOpen : false,
						breakAfterOpen : false,
						breakBeforeClose : false,
						breakAfterClose : false
					});
			}
		}
    });
</script>

Open in new window


and my config.js:
/**
 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function( config ) {
	// Define changes to default configuration here.
	// For complete reference see:
	// http://docs.ckeditor.com/#!/api/CKEDITOR.config

	// The toolbar groups arrangement, optimized for two toolbar rows.
	config.toolbarGroups = [
		{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
		{ name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
		{ name: 'links' },
		{ name: 'insert' },
		{ name: 'forms' },
		{ name: 'tools' },
		{ name: 'document',	   groups: [ 'mode', 'document', 'doctools' ] },
		{ name: 'others' },
		'/',
		{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
		{ name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
		{ name: 'styles' },
		{ name: 'colors' },
		{ name: 'about' }
	];

	// Remove some buttons provided by the standard plugins, which are
	// not needed in the Standard(s) toolbar.
	config.removeButtons = 'Underline,Subscript,Superscript';

	// Set the most common block elements.
	config.format_tags = 'p;h1;h2;h3;pre';

	// Simplify the dialog windows.
	config.removeDialogTabs = 'image:advanced;link:advanced';
};

Open in new window


Without plugins it works OK.

Can anyone tell me what the problem is please?

Cheers,

  Col
localhost-1477669786439.log
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Avatar of Colin Brazier

ASKER

Not really Ray.  They don't seem to have found an answer either, and a search for Aggregate CKeditor.js seems to bring up Drupal-related issues only, and I'm not using that.

Since the plugin-free build works, maybe I could debug by adding one plugin at a time and seeing which one causes the issue.  

On the subject of plugins, do I have to create a new build each time or could I just add a plugin folder from another build into my current one?  I know I have to enable plugins after adding them but the editor should still work even if the plugins don't.

It's been a tough week, all I seem to have been doing is chasing down problems of one kind or another.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've had another play without success...will revisit Monday.  Cheers.
Have a good weekend.
this appears that it may be related to a missing path, if the first plug-in you try fails, take it out and try another plug-in.  It may have something to do with the paths to the plug-ins, and if that's the case, it's likely any plug-in could fail

I reinstalled a vanilla version, then added one plugin that would be very useful to me.  I used CKEditor's CKbuilder app.  Running CKEditor thereafter showed a lot of bugs with the plugin.  including missing files and incorrect paths, as you indicated Ray.

After my debugging skills ran out I contacted the plugin author who advised downloading the plugin direct, as "CKbuilder has a lot of bugs relating to not loading all files".  I have done this and this particular plugin works OK.

So the moral is, try one plugin at a time, and don't use CKbuilder if it can be avoided.

Cheers
With missing files as a clue, I found the errors in the plugin's PHP code, contacted the author, downloaded the plugin directly and all seems OK.

Thanks.