Media + WYSIWYG + CKEditor 4.1+ Broken Embed Functionality


February 5th, 2014
by Chris

Recently had issues with a brand new Drupal 7 site that required the ability to embed images in a WYSIWYG field. This has been done countless times before, but for some reason this time was different. Everything installed properly, and worked as you would expect. Install and enable the modules. Configure the Text Formats to convert media tags to markup. Enabled the Media browser in the corresponding WYSIWYG profiles. All going well so far.

While trying to actually embed an image an issue is encountered. You can select a local image, you can upload the image, set alt & title tags, but when you're all done and it's supposed to insert the image...nothing, nada, zilch.

This took forever to track down the right Google search combo to find an actually usable clue. Turns out it's a known issue, and it has to do primarily with CKEditor and it's newer ACF (advanced content filtering) which will automatically strip out any tags that it believes shouldn't be allowed based on how the editor is configured (which buttons are available).

This is all discussed in a couple of threads in the Drupal issue queues, but this one appears to be a primary one. They highlight the problem, discuss workarounds, and have generated community tested and approved patches. For some reason this still hasn't been comitted to the dev branch though. So in case you run into this behavior, maybe this post will come up and and point you to the right location until the patches are comitted.

Posted in ckeditor, drupal, media, wysiwyg



Categories