CKeditor plugins with dependencies

Created on 29 February 2016, over 8 years ago
Updated 30 October 2023, about 1 year ago

I'm trying to add a new plugin with hook_editor_ckeditor_plugins(),

function my_module_editor_ckeditor_plugins() {
  $plugins['embedbase'] = array(
    'path' => drupal_get_path('module', 'my_module') . '/js/plugins/embedbase',
    'file' => 'plugin.js',
  );
  $plugins['embedsemantic'] = array(
    'path' => drupal_get_path('module', 'my_module') . '/js/plugins/embedsemantic',
    'file' => 'plugin.js',
    'buttons' => array ( 
      'Embed' => array (
        'label' => 'Embed',
        'image' => drupal_get_path('module', 'my_module') . '/js/plugins/embedsemantic/icons/embedsemantic.png'
      )
    )
  );
  return $plugins;
}

but the plugin I'm attempting to use (embedsemantic) has a bunch of dependencies. I've tried adding the dependencies to the plugins list, before and after the declaration, but the editor never seems to register the dependencies, instead only looking in the base directory :
Uncaught Error: [CKEDITOR.resourceManager.load] Resource name "embedbase" was not found at ".../sites/all/modules/contrib/editor/modules/editor_ckeditor/lib/ckeditor/plugins/embedbase/plugin.js?t=FAD9".
I've also tried hook_editor_ckeditor_plugins_alter() but it's showing the dependencies as registered in the correct location. The callback function doesn't seem to give me anything I can alter either.

I could just dump all of these into the module folder, but I'd rather not if possible. Any ideas?

πŸ› Bug report
Status

Fixed

Version

1.0

Component

CKEditor integration

Created by

πŸ‡ΊπŸ‡ΈUnited States froboy Chicago, IL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024