Feature Requests
Share ideas, discuss and vote on requests from other users in community
 
This object is in archive! 

Hooks priority management

Eduardo G. shared this idea 5 years ago
Under Consideration

As you know, the add_hook() function uses a numerical priority, like this:

  1. add_hook("ClientAdd", 1, "hook_create_forum_account");

And in many cases, this priority comes hardcoded or encrypted inside the hook code.

So, sometimes you can find one module hook overriding another one, just because they have the same proprity (most of the times 3rd party hooks have priority "1", so you cannot manage the exact order they run).

This is a problem for the WHMCS administrator, as he has no way to set the priority order of those hooks, so he needs to contact the coder and ask to change priority so all 3rd party hooks work right. Sometimes this requirement is just impossible to achieve, thus we have a hooks incompatibility.

Would be great if there's a single page where admins can manage all active hooks and move them up and down to set priorities, overriding hook's hard coded priority.

This could even be useful for other hook actions, like disabling a module's hook without disabling the module itself.

Hope I made myself clear :-P

Comments (1)

photo
1

This is a problem when we have multiple modules and need them to modify items in a certain order.

Did this ever make it into WHMCS?