Trying to do something fairly simple, using the Panopoly distro.

Basically, I'm trying to implement hook_wysiwyg_editor_settings_alter(). Within the Panopoly distro, the panopoly_wysiwyg module also implements the hook.

So if I have this structure,

/profiles/panopoly/modules/panopoly/panopoly_wysiwyg /sites/all/modules/contrib/wysiwyg_button_order /sites/all/modules/custom/my_module

No matter how I set the module weights, the hook fires in the order

  • sites/all/modules/contrib
  • sites/all/modules/custom
  • profiles/panopoly/modules/panopoly

Within the directory, execution is in alphabetical order. I've tested this by moving my_module into sites/all/modules/contrib and profiles/panopoly/modules/panopoly.

Is this a bug in Drupal? Am I missing something? I've tried to use hook_module_implements_alter() but that doesn't fire at all.

If I call modules_list(), it shows the modules in the expected order, but the hook doesn't fire in that order.

Any ideas?


The module weight can be updated in multiple ways

1) Using the Module Weight module which gives you an option to change the order of modules. This module allows only reordering of non core modules 2) Directly updating the weight field in the table "system". Refer to this link for more details.

Lesser the weight the module floats on the list and gets executed early

  • I have no problem updating the module weight. As I explain, the problem is that the order of execution for the hook is not respecting the weight. So I can set the weight to 9999 but it still executes before other modules with weights of zero.
    – ergophobe
    May 10 '14 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.