Hello,

When you use linkit with ckeditor, the popin doesn't respond correctly and few error JS is send to the console :

afterInit() is undefined and insertLink() is undefined.

This error is send because ckeditor/linkitDialog.js or tinymce/linkitDiablog.js is loaded before linkit.js, linkitdashboard.js

You must use dependencies for the ckeditor/linkitDialog.js, tinymce/linkitDiablog.js in linkit.module in your hook_library.

The $libraries['field'] has been the "dependencies" information, but no ckeditor or tinymce

I have create a patch for the version "7.x-3.1" and is join to this issue.

// Linkit ckeditor dialog script.
  $libraries['ckeditor'] = array(
    'title' => 'Linkit CKeditor',
    'js' => array(
      $path . '/editors/ckeditor/linkitDialog.js' => array('group' => JS_DEFAULT),
    ),
    'dependencies' => array(
      array('linkit', 'base'),
    ),
  );

  // Linkit tinymce dialog script.
  $libraries['tinymce'] = array(
    'title' => 'Linkit TinyMCE',
    'js' => array(
      $path . '/editors/tinymce/linkitDialog.js' => array('group' => JS_DEFAULT),
    ),
    'dependencies' => array(
       array('linkit', 'base'),
    ),
  );

Best regards,

Sébastien

CommentFileSizeAuthor
linkit.module.do-not-test.patch756 bytessebyoga

Comments

sebyoga’s picture

Status: Needs review » Active
dazz’s picture

I'm getting another error but I think its related to this problem.
When I open the dialog I get the error

Object #<Object> has no method 'populateFields'  in linkitDialog.js row 48

It seems to be missing this function from /better-autocomplete/jquery.better-autocomplete.js

anon’s picture

Status: Active » Fixed

Thanks for the patch, its now commited.

  • Commit 320c3d2 on 7.x-3.x authored by sebyoga, committed by anon:
    Fixed #2207099 by sebyoga - When you use ckeditor with linkit and...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.