Anyone had issue with IE8 and CKEditor 4 ? I am getting following error
SCRIPT5007: Unable to get property 'items' of undefined or null reference
ckeditor.js, line 630 character 449
It works fine with all IE9 and above browsers. Any prompt help and reply is highly appreciated
Thanks
I have the same issue
Any help would be much appreciated.!!!!
More info please
Is this during initialization or some action? Do you have custom plugins? Inline or not inline? What config do you use? Can we see an example?
More info...
Thanks for the response - for me, it seems to happen on initialisation...or it doesn't initialise on IE8. This is wierd though because I do have some elements within other containers on a couple of pages that do work with a extremely basic toolbar setup (just styles dropdown).
One issue perhaps could be that I am setting elements as contenteditable using jquery when the dom is ready as only certain users have this right, so if a user is logged in with rights another javascript file is included in the page to perform this function.
I imagine it would be something to do with the styling of the container, but that is hard to beleive I think from the error response. I also put custom attributes on the same contenteditable element for custom javascript functions. Can this cause issues?
The ckeditor is inline and the magicline plugin is included. I have just tried taking that plugin off and it hasn't made a difference.
What should the 'undefined' object be? I can't seem to output any content of that object in any browser versions, JSON.strigify parses it and outputs an empty object.
I've tried moving the ckeditor script around in the head of the document to see if the order things were functioning made a difference.
I use jQuery and some jQuery plugins as well as custom code I've created but haven't been able to remove anything to isolate the issue yet. Jquery version 1.9.1 with plugins: form,selecbox-0.2 & ambiance.
What process would you go through normally if you experienced this issue? I must be missing something and I'm assuming to do with the contendeditable container...I'll keep playing around with it for half an hour a day or so and see if I get anywhere too.
Thanks for your help!
Here is my config:
/**
* @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
config.toolbar = config.toolbar_Full =
[
{ name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] },
{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
{ name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
{ name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
'HiddenField' ] },
'/',
{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
'-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
{ name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] },
'/',
{ name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
{ name: 'colors', items : [ 'TextColor','BGColor' ] },
{ name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] }
];
config.toolbar_Basic =
[
{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteFromWord','-','Undo','Redo' ] },
{ name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
{ name: 'styles', items : [ 'FontSize' ] },
{ name: 'colors', items : [ 'TextColor','BGColor' ] },
'/',
{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','-','RemoveFormat' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList',
'-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] },
{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
];
config.toolbar_BasicPrices =
[
{ name: 'clipboard', items : [ 'Undo','Redo' ] },
{ name: 'styles', items : [ 'Styles' ] }
];
// Define changes to default configuration here.
// For the complete reference:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbar = 'Basic';
//config.enterMode = 2;
//config.shiftEnterMode = 1;
config.forcePasteAsPlainText = true;
//config.stylesSet = [{ name : 'Intro Text' , element : 'span', attributes : {'class':'intro-p'} }];
config.extraPlugins = 'magicline';
};
Figured one stage out
It seems as I thought with the 'items' being undefined that it is related to the toolbar configuration. When I simplify the toolbar to 'undo','redo' and 'styles' dropdown it works...I'll just figure out what item(s) are causing IE8 to fail and check if it is a known issue.
...No idea but looks like perhaps the break line
The break line in the items list for the Basic toolbar I think may have caused that error. This toolbar config works fine now...
config.toolbar_Basic =
[
//{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteFromWord','-','Undo','Redo' ] },
{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteFromWord','-', 'Undo','Redo' ] },
{ name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
{ name: 'styles', items : [ 'FontSize' ] },
{ name: 'colors', items : [ 'TextColor','BGColor' ] },
'/',
{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','-','RemoveFormat' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] },
{ name: 'links', items : [ 'Link','Unlink','Anchor' ] }
];
So it works now? Cool, way to
So it works now? Cool, way to go!
Usually what I do when I encounter a bug like this is
So very close to what you did. I could spot a small issue on first look; when you have
in your config, notice that you have an extra comma there between } and ] - that might for example cause IE8 to blow up, some browsers are very particular about this. In your latest message that red comma is not there - that might explain the error!
Indeed!
Indeed thanks! Thanks for the advice in future, good ways of bug fixing, I've done things similar before it just seemed this one stumped me for a while, probably more tired than normal when I was looking at it yesterday.
Yes noticed that comma while bug fixing and had that hurrah moment thinking it was about to all work, and it didn't change anything, but in all likliness, it was probably a combination of that comma and the extra break line. IE sucks!!...but I should have been better at coding too.. :-P
Thanks again for the help, it prompted me to keep checking this morning and I hope this thread helps others with similar issues.
P.s. the new code does have a line commented out still which is redundant and an exact copy of the line below just left over from bug fixing tests for anyone looking.
Same here
Thanks for noting this. I had a trailing comma in my latest config too. It was killing initialization in ie8 and creating warnings in ie9. Both work now.
Arrays cannot end with a comma in IE8
You need to remove the last comma before closing the array for the error to be removed. This only effects IE < 9