media 7.x-2.0-alpha3+114-dev
ckeditor 7.x-1.15+2-dev
fresh d7 7.31 instance created to test this integration

There still seems to be some issues regarding the "media" plugin namespace when using the ckeditor module. In an effort to try and understand this, I built a new D7 instance with these modules listed above.

What I found was that first of all, the media modules "media" plugin was not overriding that of ckeditor. The only way I was able to get the media module version to load in the ckeditor/admin pages was to insert
module_load_include('inc', 'media_wysiwyg', 'media_wysiwyg.ckeditor');
right before any calls in ckeditor module to
$plugins = module_invoke_all('ckeditor_plugin');.

So I've filed an issue over at ckeditor module CKEditor plugins registered by hook does not include "media" module. I'm sure that if this hook existed in the .module file it would load just fine.

However even after this, I noticed that the media_wysiwyg.filter.js is not present when the CKEditor initializes, hence I get the editor with nothing in it. The js error is TypeError: 'undefined' is not an object (evaluating 'Drupal.media.filter.replaceTokenWithPlaceholder') since media_wysiwyg.filter.js is just not there.

The only way I was able to get past this was to actually force the loading of media_wysiwyg.filter.js inside of the .info file and now everything works. Obviously this is not a recommended solution.

Additionally, the implementation of hook_ckeditor_plugin() in media_wysiwyg.ckeditor.inc is incorrect:

'path' => base_path() . drupal_get_path('module', 'media_wysiwyg') . '/wysiwyg_plugins/media_ckeditor/',
should be
'path' => drupal_get_path('module', 'media_wysiwyg') . '/wysiwyg_plugins/media_ckeditor/',

Comments

blasthaus’s picture

Issue summary: View changes
chris matthews’s picture

Status: Active » Closed (outdated)
Issue tags: -ckeditor

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team