Jump to content

Actionhooks dont function how the docs say they do.


ServWise.com

Recommended Posts

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 by ServWise.com
Link to comment
Share on other sites

  • 1 month later...

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 :)

Link to comment
Share on other sites

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?

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