Jump to content

And more hooks that don't work for years?


yggdrasil

Recommended Posts

In the past, I reported hooks not working for WHMCS and its over a year and it seems they are still not fixed. Like for example the hook AfterRegistrarSaveNameservers which never worked for me. (does not fire)

But today I was trying to use the AfterRegistrarRegistration hook and while this hook at least does fire and gets executed I noticed that no parameters work here. I just get blanks !!!

In the documentation it says:

https://developers.whmcs.com/hooks-reference/registrar-module/#afterregistrarregistration

They are available as params in an array and they point to the following link:

http://developers.whmcs.com/domain-registrars/module-parameters/

Now, here comes the first strange part. The hooks, all of them use $vars, not $params which is used in modules, maybe this is a typo in the docs and they refer to vars the. Either way I tried both. This does not work:

$domain = $vars['domainid'];

No $vars work for me at all. So I tried using the params from modules (as per WHMCS docs) and it does not work either:

$domain = $params['domainid'];

I did tried changing the hook as well to use $params

Original:

add_hook('AfterRegistrarRegistration', 1, function($vars)

I tried as well:

add_hook('AfterRegistrarRegistration', 10, function($params)

I still get blanks. I searched the forums before posting this and found this (no solution):

https://whmcs.community/topic/106849-actionhook-afterregistrarregistration/

https://whmcs.community/topic/183073-params-in-afterregistrarregistration-hook/?tab=comments#comment-893361

https://whmcs.community/topic/185917-afterregistrarregistration-not-working/?tab=comments#comment-903713

Those posts are from 2013 !!! Now I'm worried. Has WHMCS still not fixed this hook either? Or how exactly do I use the parameters to get some basic data like the domain and domain ID.

Link to comment
Share on other sites

SOLVED after finding this post:

It seems these particular hook require a bit different approach for the parameters. For example:

$domainid = $vars['params']['domainid'];

I hope this helps anyone else looking this :)

Edited by yggdrasil
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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