Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Welcome pack plugin errors : missing argument


pangloss
Participant

@pangloss

I was able to correct this problem with some mods to the welcome-pack.php file.

And I must preface this by saying that this fix is a hack. I am really not that familiar with the plugin and don’t know that my changes won’t result in some problem.

Basically, it appeared that none of the following functions were using the $meta value being passed in. So, I removed it. Here is the simple change. For each of these three, around lines 74, 102 and 132, respectively – change them from this:

function dp_welcomepack_welcomemessage( $user_id, $password, $meta )

function dp_welcomepack_defaultfriend( $user_id, $password, $meta )

function dp_welcomepack_defaultgroup( $user_id, $password, $meta )

to this:

function dp_welcomepack_welcomemessage( $user_id, $password )

function dp_welcomepack_defaultfriend( $user_id, $password )

function dp_welcomepack_defaultgroup( $user_id, $password )

That will correct your undefined argument problems.

After that, you will need to add the following code to the function “dp_welcomepack_defaultfriend” which starts at line 102. At the end of the function, just before the line “friends_add_friend( $friend, $user_id );” add the following conditional code:

if(is_array($user_id)){

$user_id = implode($user_id);

}

This should solve your array problem. Note!!! I am not entirely sure why the user_id value was being converted to an array in the first place, so, make these changes with that in mind. I don’t believe it will be a problem but it is possible that somehow you might get an actual array of more than one value and that would be an issue. One way to check this that I did not add would be to get an array count if it is an array and only set the value if it’s equal to 1.

Skip to toolbar