2
votes

I have a custom module which allows a user to invite friends to see his/her favourite(flagged) nodes.

Upon the invitation/registration.. I want to be able to duplicate the (inviter)users flags for the new(invited) user.

i read http://drupal.org/node/305086 and it says to use:

function flag($action, $content_id, $account = NULL, $skip_permission_check = FALSE)

however regardless what value i put in for $account the new flag is not created for the new user.

can anybody assist please!

1
Can you add some example code of what you currently are doing. - googletorp

1 Answers

5
votes

$account must be a user object, implemented with $account = user_load(array('uid' => 123));. Are you doing this?