CKEditor 4.5.8 working perfectly in Drupal 7.50 with CKEditor module and Insert module but two points in the install instructions need clarifying. Currently instructions say to install the plugins to CKEditor in the Libraries directory but this did not work (though presumably that works when using WYSIWYG module). Currently CKeditor module (not CKeditor used via WYSIWYG module) accesses a copy of the CKEditor download stored within the module's own directory - installing the plugins there did work.

Also the module has two plugin locations, seems both will work but one is probably intended for Drupal-specific plugins:
modules/ckeditor/ckeditor/plugins
modules/ckeditor/plugins

Also, it would be plus to be able to retain classes assigned to images by the Insert module.

Comments

Andru created an issue. See original summary.

Andru’s picture

Also had to change a path to get this working 100% with just the CKEditor module, no WYSIWYG module

(was not loading ckeditor_image_2_config.js from the module folder)
it was looking for it in the libraries folder, had to edit one in ckeditor_image2.module line 73
// $settings['customConfig'] = $return_to_base . $module_path . 'ckeditor_image2_config.js' . $query_string;
//REPLACED WITH THE FOLLOWING as it was looking for this in libraries, not the module folder
$settings['customConfig'] = base_path() . $module_path . 'ckeditor_image2_config.js' . $query_string;

jwilson3’s picture

Regarding the original issue here, you've installed CKeditor in the wrong location. This module requires that the CKeditor library is installed into sites/all/libraries and the module depends on the Libraries API module to calculate the location. This is well documented on the Project page as well as in this module's README file shipped with the code.

The whole point of the code as-written was to handle the fact that 'customConfig' value is a relative URL based on the location of "ckeditor.js" As can be seen in the code comment here:

 // Calculate the relative path of the custom configuration file by adding
  // sets of "../" to the path in order to return to the base_path because
  // the customConfig path value is *relative* to the location of the
  // CKEditor library, usually located in sites/all/libraries/ckeditor.
  $module_path = drupal_get_path('module', 'ckeditor_image2') . '/';
  $query_string = '?' . variable_get('css_js_query_string', '0');
  $return_to_base = str_repeat('../', count(explode('/', libraries_get_path('ckeditor'))));

Now, I'm seeing that this same set of lines of code that was is impacting you, is also impacting the CDN version of CKEditor as reported on #2725875: CDN version compatibility.

http://cdn.ckeditor.com/sites/all/modules/ckeditor_image2/ckeditor_image2_config.js/ net::ERR_ABORTED 404 (Not Found)

So the overarching problems are two-fold:

1) I'm not sure how the CDN version can support a remote 'customConfig' -- there must be a way, I just don't know off hand without more investigation. If we can figure out how this works within the CKeditor module itself, then we can apply this logic to our module in the CDN configuration, eg with an absolute URL pointing to the locally hosted ckeditor_image2_config.js file.

2) If we figure out a solution for #1 then in theory we wouldn't need to do the funky relative URL calculations, and just use an absolute url, and this might very well solve the original problem reported here.

jwilson3’s picture

Status: Active » Closed (works as designed)

#2725875: CDN version compatibility has been fixed. I'm closing this one as works as designed per the first paragraph in comment #3.