Note: CKEditor Version at the time of this writing: 4.5.6

Problem/Motivation

Currently, some custom plugins downloaded from http://ckeditor.com/ won't have their buttons available on the Drag & Drop toolbar wizard, even though the plugin is available in the "Plugins" list on the CKEditor profile edit page. If you disable the toolbar wizard, and manually enter the button name in the text-based configuration field, the button will appear when you actually go to use the editor on a node form (for example). You can test this out with the Tweetable Text plugin:

  1. Place it in the plugins directory (configured on the Global Settings page: admin/config/content/ckeditor/editg)
  2. Disable the Toolbar Drag & Drop Feature on the Global Settings page
  3. Edit the profile you wish to use the plugin on and enable the plugin ("Plugin file: tweetabletext")
  4. Manually add the button name (TweetableText) to the toolbar configuration textarea.
  5. Then add/edit a node that has the editor on it and you should see the button.

I believe the problem is that CKEditor has changed the method for defining plugin button icons, but the CKEditor module hasn't updated the icon discovery code for the administration pages. The current method for adding button icons is by putting them in an "icons" folder with the filename being the lowercased button name (ref http://docs.ckeditor.com/#!/guide/plugin_sdk_sample).

Proposed resolution

Check for icons in the button definition first, otherwise assume there is an icon in the icons folder. If there is no icon in the icons folder (i.e. if the icon method changes again), the button will at least still show up on the administration page as a broken image with the ALT text so the user can still position it using the drag & drop interface.

Remaining tasks

Review Attached Patch, commit. :)

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drclaw created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, ckeditor-toolbar_wizard_buttons-0.patch, failed testing.

drclaw’s picture

drclaw’s picture

Status: Needs work » Needs review

Patch failed because of a CI error... this module doesn't have any tests anyway so... needs review again? :)

AaronMcHale’s picture

Patch works great, thanks :D

jcisio’s picture

So this is a long time bug, not new one and unrelated to the recent plugin system change. This patch makes an assumption on the plugin filename and extension, however all plugins that I check follow this pattern, so it's ok for this fallback.

Committed and pushed. Thanks.

  • jcisio committed 3657990 on 7.x-1.x authored by drclaw
    Issue #2644124 by drclaw: Some CKEditor plugins buttons don't appear in...
jcisio’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

candelas’s picture

Thanks @drclaw I was getting nuts with icons not showing :)