bytebeam Posted January 5, 2014 Share Posted January 5, 2014 Usually, systems accepting custom hooks implement basic error checking by testing the return value of hook functions. This allows the hooked process to decide the appropriate course of action according to the hook's returned value (for ex. continue in case of success or abort in case of failure, etc...). In a PHP function this means simply returning false or true, 0 or 1, an array, or any other established convention. I'm surprised I don't see return values in the source code of hook functions I have checked. It is difficult to imagine that the hooked processes do not already perform themselves due error checking over their normal original workflow. Can somebody confirm that hook functions can return some kind of values which can condition further normal WHMCS processing ? 0 Quote Link to comment Share on other sites More sharing options...
bytebeam Posted January 8, 2014 Author Share Posted January 8, 2014 No replies... Then I guess WHMCS does not check the return value of hook functions. I did find one thread about the same matter: http://forum.whmcs.com/showthread.php?67007-hook-error-handling-not-documented&highlight=hook However it does not clarify if the $errormessage variable is merely devoted to the display of error messages, or if the normal workflow of a hooked process is altered according to the contents of this variable. Any hints ? 0 Quote Link to comment Share on other sites More sharing options...
And then there was one les Posted July 29, 2014 Share Posted July 29, 2014 No replies... Then I guess WHMCS does not check the return value of hook functions. I did find one thread about the same matter: http://forum.whmcs.com/showthread.php?67007-hook-error-handling-not-documented&highlight=hook However it does not clarify if the $errormessage variable is merely devoted to the display of error messages, or if the normal workflow of a hooked process is altered according to the contents of this variable. Any hints ? To find out what the inner workings of whmcs hook points are doing in regards to errors you would need to speak to the developers. All i can tell you is broken hooks/modules will often result in blank pages so that tells me there is as far as i can tell no graceful fallback in these cases. If you find out it is the case then ofcourse you can put in a feature request, or at the very lease suggest to the devs directly a method that would deal with your case. 0 Quote Link to comment Share on other sites More sharing options...
kaufenpreis Posted July 30, 2014 Share Posted July 30, 2014 Bytebeam, please write, did you find answer for your question? 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.