I have a couple of really simple plugins I've created in a custom module and tested on a development site. When I enable my module, however, the plugins don't show up, for example under /admin/config/content/wysiwyg/profile/filtered_html/edit

This happened during development as well. I cleared the cache, looked at the wysiwyg table in the database, couldn't figure out what was going on, and then mysteriously, they showed up. Now that I've enabled my module on our production site, the same thing is happening. in MYMODULE.module I have implemented hook_wysiwyg_include_directory like so:

/**
 * Implementation of hook_wysiwyg_include_directory
*/
function MYMODULE_wysiwyg_include_directory($type) {
        return $type;
}

and in plugins/myplugin.inc I have implemented hook_wysiwyg_plugin like so:

/**
 * Specially named implementation of hook_wysiwyg_plugin().
 *
 * Should be named {$module}_{$plugin}_plugin().
 */
function MYMODULE_MYPLUGIN_plugin() {
  $plugins['MYPLUGIN'] = array(
    'title' => t('My Plugin'),
    // The 'icon file' is the icon that appears in the Wysiwyg toolbar.
    'icon file' => 'myplugin-icon.gif',
    'icon title' => t('My Plugin Tile'),
    'settings' => array(),
        'extended_valid_elements' => array(
                'div[class]',
        ),
  );
  return $plugins;
}

Am I missing something that is needed to make the plugin show up upon enabling the module?

Comments

TwoD’s picture

Status: Active » Fixed

The wysiwyg table isn't changed when new plugins are discovered, only when a profile is saved.
Wysiwyg module does not [yet] cache any information returned from hooks it calls, so that should not been a problem.
Howeber, you need to clear the caches for Drupal to actually find the new hook implementation in already enabled modules, which is the same no matter which new hook you implement. When enabling a new module which implements a hook, Drupal should have discovered the new hook though.

Either way, there's nothing Wysiwyg module itself can do about this, since Drupal Core is responsible for discovering hook implementations, no matter which module calls those hooks. The only thing I can think of is if you're possibly using a bytecode caching mechanism (like APC) and that didn't pick up the new files correctly. Sounds strange though.

Status: Fixed » Closed (fixed)

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