Module weight not being respected in order of execution 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