CKEditor completely breaks with the following JS error:
GET http://[sitename]/sites/all/modules/contrib/linkit/editors/ckeditor/%base_path%sites/all/modules/contrib/linkit/editors/ckeditor/linkit.png 400 (Bad Request)
on /admin/config/content/ckeditor/edit/Full page. Somehow plugin generates the button path incorrectly (%base_path%) and instead of the linkit icon there is a "null" value.

I believe that as a result of the above error CKEditor does not work on node edit forms anymore and returns the following JS error: "Uncaught TypeError: Cannot read property 'icons' of null"

Modules being used:

  • Linkit 7.x-3.x-dev
  • CKEditor 7.x-1.12
  • CKEditor library (4.0)

This issue does not arise in Linkit 7.2 branch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anon’s picture

Project: Linkit » CKEditor 4 - WYSIWYG HTML editor
Version: 7.x-3.x-dev » 7.x-1.x-dev
Priority: Critical » Normal

Linkit (7.x-3.x) is not responsible for the integration with the ckeditor module.
Ckeditor module has its own implementaion for Linkit.

mkesicki’s picture

Thank you for reporting this issue. We try check this as soon as possible.

7wonders’s picture

getting the icon to show in the admin is an easy fix:

'icon' => 'linkit.png'

but linkit integration still seems to be broken with:

linkit 7.x-3.x-dev
ckeditor 7.x-1.12+9-dev

anon’s picture

The bug exists in the ckeditor module for sure.

Linkit 7.x-3.x (2013-Mar-06) doesn't implement the hook_ckeditor_plugin() and the choose to use Linkit is still in the ckeditor settings.

This means that someone is doing some magic stuff, and in this case it is the Ckeditor module.

I have implement hook_ckeditor_plugin() in Linkit and this will "fix" it, but the error in the CKeditor still exists.

wwalc’s picture

Thanks anon for fixing it in the Linkit module. Indeed it looks like there is a problem with ckeditor_plugins_render() function that corrects the path property only.

In this particular case, the path to an icon is incorrect:

  ["linkit"]=>
  array(5) {
    ["name"]=>
    string(6) "Linkit"
    ["desc"]=>
    string(56) "Support for the Linkit module <em>(buttons: Linkit)</em>"
    ["path"]=>
    string(46) "/d7/sites/all/modules/linkit/editors/ckeditor/"
    ["buttons"]=>
    array(1) {
      ["Linkit"]=>
      array(2) {
        ["title"]=>
        string(6) "Linkit"
        ["icon"]=>
        string(63) "%base_path%sites/all/modules/linkit/editors/ckeditor/linkit.png"
      }
    }
    ["default"]=>
    string(1) "t"
  }

so it looks like all placeholders in "icon" entries should be replaced as well.

stoickthevast’s picture

Im also experiencing this error

Uncaught TypeError: Cannot read property 'icons' of null

when I enable my custom plugin.

wwalc’s picture

Any chance to get your plugin to check what's wrong?

stoickthevast’s picture

FileSize
896 bytes
383 bytes

My plugin is working when others plugin is disabled, but when I enabled any of them it throws JS error.

The structure of my plugin

qna
  * icons 
     * qna.png
  * css
     * qna.css
  * plugin.js