ServWise.com Posted June 30, 2009 Share Posted June 30, 2009 (edited) Since V4 a new way of referencing actionhooks has appeared. From the docs function create_forum_account() { $vars = func_get_args(); print_r($vars); } add_hook("ClientAdd",1,"create_forum_account",""); Note the line $vars = func_get_args(); All fine however $vars are now referenced by a number not a name. I can't use $vars["invoiceid"] I have to use $vars[10] (This is how Matt instructed me to do things after I complained that the action hooks were not working) The docs do not say what each number references in each hook and in fact still show the old way of referencing them as names. And it is very inconvenient to do a print_r($vars); to find out what they are. Personally I think it is crazy to reference the array values by a number, what happens if you remove a variable one day everything is going to shift and break. Please reinstate the old way of referencing. Edited June 30, 2009 by ServWise.com 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted July 1, 2009 WHMCS CEO Share Posted July 1, 2009 Thanks for your feedback. It was an oversight that name references didn't work in v4 and so they will be available again in 4.1. Matt 0 Quote Link to comment Share on other sites More sharing options...
ServWise.com Posted July 1, 2009 Author Share Posted July 1, 2009 That's great to know. 0 Quote Link to comment Share on other sites More sharing options...
netearth Posted August 8, 2009 Share Posted August 8, 2009 Hi Matt, Although you have stated "name references" will be back in 4.1, is there actually a list you can paste for the numbers? I am specifically looking for what used to be : actionhook_ClientSignup($vars) and actionhook_ClientDetailsEdit($vars) Thanks, Chris 0 Quote Link to comment Share on other sites More sharing options...
Chrisw Posted August 9, 2009 Share Posted August 9, 2009 Chris, I created a basic actionhook to dump the vars for clientedit [0] => client ID [1] => Firstname [2] => Lastname [3] => company [4] => email [5] => address 1 [6] => address2 [7] => city [8] => state [9] => zipcode [10] => country [11] => phone number Is this what you are after? 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.