PixelPaul Posted June 3, 2021 Share Posted June 3, 2021 Hello, With the ClientAreaPageProductsServices Hook for a module, you can modify and return the values off the hook to be used on the template of the page. But i have noticed if you have another module hook doing the same, which ever one was run first will get overwritten by the 2nd values. It seems like the default values get provided to each hook. So if you have one module using the hook and returning the modified values, it works fine. But when you have two modules with the same hook being used. because the default values get provided to both, no matter if one modified the values. Only the final module running the hook will have their modifications passed onto the template. Is there a way to fix this? So modifications made by all module hooks for that function will be provided to the template? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 3, 2021 Share Posted June 3, 2021 4 hours ago, PixelPaul said: But when you have two modules with the same hook being used. because the default values get provided to both, no matter if one modified the values. Only the final module running the hook will have their modifications passed onto the template. you might want to look at priorities, e.g the order in which hooks using the same hook point are called. https://developers.whmcs.com/hooks/priority/ 0 Quote Link to comment Share on other sites More sharing options...
PixelPaul Posted June 3, 2021 Author Share Posted June 3, 2021 (edited) the ordering does not changes the problem, it just orders the module hooks. the last one still gets the variables which have not been modified by previous modules, and provides the final variables. the WHMCS hooks system is very flawed Edited June 3, 2021 by PixelPaul 0 Quote Link to comment Share on other sites More sharing options...
heapmaster Posted July 19, 2021 Share Posted July 19, 2021 I submitted this as an Idea so they can fix this, maybe we can get some more votes to make it happen! https://requests.whmcs.com/idea/hook-return-issues-including-more-then-one-hook-point-compatibility-and-changes-to-smarty-variables 0 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.