Closed (fixed)
Project:
CKEditor 4 - WYSIWYG HTML editor
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2011 at 15:32 UTC
Updated:
1 Aug 2011 at 08:42 UTC
Some time we receive a Javascript error in the file ckeditor.utils.js line 2:
Drupal.ckeditor = (typeof(CKEDITOR) != 'undefined');
Error "Drupal is undefined".
After searching, i saw the javascript ckeditor.js was loaded beford drupal.js which can cause bug. ckeditor.js is included in the file ckeditor.module line 576:
drupal_set_html_head('
');
I changed this line which include the JS at the start of the HEAD. I replaced this line with:
drupal_add_js($editor_local_path .'/' .$conf['ckeditor_load_method']);
Now the JS is in the good place and i dont have any error.
David
Comments
Comment #1
mkesicki commented@dblais thanx for your patch. We will check this.
Comment #2
dczepierga commented@dblais, really thx for report it... i make some more changes of loading CKEditor libraries files and commit to GIT.
Pls check last DEV version of CKEditor module.
Greetings
Comment #3
jcisio commentedI think it needs more test because this makes the 300 KB ckeditor.js included in the JS aggregate file, something that we don't want to do.
Comment #4
dczepierga commented@jcisio, so what u suggest to do with it?
Greeting
Comment #5
jcisio commentedhttp://api.drupal.org/api/function/drupal_add_js/6
By default we have $preprocess = TRUE, so I think what we want to do is to set $preprocess = FALSE.
What I'm not sure is that why this module used drupal_set_html_head() instead of drupal_add_js(). I investigated once, but I don't remember now. The reason could be that with drupal_set_html_head(), it is possible to load CKEditor from a CDN in D6.
Comment #6
mkesicki commentedComment #7
dczepierga commentedOk i change this, and now ckeditor.js isn't aggregated...
Before we used drupal_set_html_head(), becuase CKEditor now work with aggregation and was problem with place where is loaded... When we fix problem with Google Page Speed we also remove problem with aggregation, so now everything works fine :)
Greetings