3

I am trying to implement hook_menu_alter in my module, but I am finding that revisioning_menu_alter is always being called after my hook, regardless of what I set my module's weight to. It seems that this is because the revisioning module does not appear in the system table at all, even though it is enabled.

What is going on? How can I make my module's hook get called after revisioning's hook? Don't modules always have to have an entry in the system table?

1 Answer 1

2

If revisioning does not appear in the system table, it is considered not installed and hook implementations it provides are not executed.

Upon installation, the revisioning module updates its weight to 1, making its hook implementations run later than those of most other modules (which default to a weight of 0).

If you want to change the order in which implementations of a particular hook are executed, have a look at hook_module_implements_alter().

2
  • Thanks. I knew that there was something wrong; it turned out that I forgot that the site I was working on used a db_prefix, and somehow there was another entire copy of every table in the site without the prefix -- and I was modifying the wrong system table. Ouch! I don't know how the copy got there. Thank you for your answer. Aug 28, 2012 at 13:29
  • I will add that hook_module_implements_alter is a far superior solution to setting the module weight in the system table. Not only is it less prone to user error, but it also provides the ability to cause some hooks to be called first, and others to be called last, which is a great improvement. Aug 28, 2012 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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