Waiting for Approval Posted April 11, 2021 Share Posted April 11, 2021 Hi there, I've create the hook "ClientAreaFooterOutput" under "/includes/hooks/" and it works perfectly. Then, I've decided to move it into custom addon under: "modules/addonname/hooks.php" - no error, no activity - just stopped working. Any ideas why? 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted April 12, 2021 Share Posted April 12, 2021 We had a similar issue once. A hook for one of our modules wouldn't work on one WHMCS installation but worked fine on the rest of our installations. It was a problem for weeks. At the end, I just left it. It wasn't something critical. While we had the issues, I started developing another module which also used hooks. For some weird reason, this solved our issues with the first module's hooks - despite no changes being made to that module. The two modules didn't even use the same hook events. I still don't know what went wrong. Make sure that the addon is enabled (try disabling and enabling again). Try disabling most of your code in that hook except something line "logActivity('test');". 1 Quote Link to comment Share on other sites More sharing options...
ChrisTERiS Posted April 16, 2021 Share Posted April 16, 2021 @Waiting for Approval https://developers.whmcs.com/hooks/module-hooks/ Quote Please note that hook files are detected at the time a provisioning, registrar, or addon module is activated. If a hook file is added after the module has already been activated, some additional steps may need to be performed for WHMCS to recognize it. For provisioning modules, this can be accomplished by accessing the Module Settings tab of an applicable product under Setup > Products/Services > Products/Services and clicking Save Changes. For a registrar module, re-saving the settings for it under Setup > Products/Services > Domain Registrars would be sufficient. Finally, for addon modules, re-saving the settings under Setup > Addon Modules will address this. Also be sure that your filename is hooks.php. I wasted lot of time trying to understand why the file myhook.php was working at includes/hooks/ and not at modules/addons/..... I forgot to rename the file to hooks.php As advice: Let your hooks at includes/hooks/. You can change them as many times as you want. The only problem is that if you upload the hook before activating your module, in most cases you'll get database error in public area (if your hook have queries). Chris 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.