Jump to content

Update Addons Hooks When Module Is Active


JuniYadi

Recommended Posts

Hi, so i'm reading in here https://developers.whmcs.com/hooks/module-hooks/

 

In hooks.php file addons Hook files are only detected at the time a module is activated and configured. If you add your hook file after the module has already been activated, you may need to deactivate and reactivate your module in order for WHMCS to recognise it.

 

any recomendation tricks to load  hooks.php directly in addons without deactive? Since if deactive and actived again, it's need reconfigure with the database.

Link to comment
Share on other sites

SELECT value FROM tblconfiguration WHERE setting = 'AddonModulesHooks' LIMIT 1

It will return a comma separated list of addon modules that use action hooks:

SexyModule,FindYourWallet,AnotherSexyModule,ModuleAboutAffiliations,ModuleAboutBillingStuff

Let's say that your module is named JuniYadi. As you can see it's not listed in the above string that's why your hook.php is ignored. All you need to do is the following:

SexyModule,FindYourWallet,AnotherSexyModule,ModuleAboutAffiliations,ModuleAboutBillingStuff,JuniYadi

Important: you have to be very careful when you play with this string because you could break other modules. For example imagine what happens if you end up with this string:

ModuleAboutAffiliations,ModuleAboutBillingStuff,JuniYadi

3 modules are missing and can no longer run their action hooks. And what about this?

JuniYadi

For sure your module will work but your customer will kill you for breaking his WHMCS.

Edited by Kian
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated