Jump to content

AfterModuleCreate hook - odd behavior - guru advice needed


marke

Recommended Posts

Hi,

 

I need some help figuring this out:

 

I have a hook function written for the AfterModuleCreate hook.

 

It runs fine when I purchase one cPanel hosting account as a customer. Everything works perfectly, WHMCS does its work and cPanel creates the hosting account. No errors anywhere, not in error_log or on the screen.

 

But, if I buy 2 hosting accounts at the same time in the shopping cart then the hook is not called twice - it's only called once. And cPanel only creates one hosting account. The WHMCS order is created, it shows both purchases, but only one cPanel account is created.

 

So I'm thinking that maybe (just guessing) something in my hook function isn't returning properly the firsts time it runs, and so WHMCS never calls the hook function again, because WHMCS never tries to create the second hosting account either. Not sure why. However I know for a fact that the function runs correctly the first time all the way to the end of the function because I put logging code in it to trace it step by step all the way to the end of the function.

 

Now if I simply put a line of code at the top of the hook function to write a log message (for debugging) and then immediately return from the function, then it DOES run twice as it should and cPanel creates 2 hosting accounts as it should.

 

Is this hook supposed to return some value or data in particular?

Any idea why it might behave this way?

I'm stumped!

 

Any help you can offer is much appreciated.

 

Mark

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