I have created a custom module which implements the hook_menu_alter in order to override those two paths and to add my own access control logic:

$items['taxonomy/term/%taxonomy_term/edit']['access callback']

$items['taxonomy/term/%taxonomy_term/edit']['access arguments']

Looking for an out of the box solution I found this module vppr which overrides the exact same paths adding its own logic.

The point is that if I have both modules enabled - vppr module and my custom module - the ['access callback'] from my custom module is never fired. If I disable the vppr module my module is working fine.

Is that possible, two different modules can't override the same path or I'm missing something, and why the ['access callback'] from the contrid module is executed over mine?



There can only be one set of metadata for a single path. Hooks are invoked sequentially, so yes, if you have another module altering the same path, either yours or theirs will 'win'; never both.

You can control the order hooks are called in using the 'weight' column in the system table, or through the use of hook_module_implements_alter().

  • Thank you very much! Your answer(s) is/are really helpful. I could never imagine something like that: "either yours or theirs will 'win'; never both.". The proposed hook seems to add some order in the hooks chaos but it also seems a little scary in terms of implementation, at least for non experienced developers, thanks again!
    – mchar
    Jun 2 '15 at 10:00

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.