I am looking for a hook to fire off an Entity creation method (for an unrelated item that pertains to the user) when a user registers for the site. I'm divided between hook_form_user_register_form_alter and hook_user_insert. What's the best approach here, and i'm wondering which one is the best to use here.
-
can we have clear information what exactly you looking for ? Required more information :)– Krishna KanthCommented Oct 14, 2014 at 11:01
-
Sure -- I have an entity that essentially serves as a has-many to about 20-30 nodes with a specific content type (pertaining to a "Daily Tasks" content). The hierarchy for the entity works out to having an ID reference to the user associated, the node id reference, and if the node is "completed." In essence, I need to insert 20-30 Entity records pertaining to each node per a newly created user.– Cameron KilgoreCommented Oct 14, 2014 at 12:38
Add a comment
|
1 Answer
After doing my due diligence, I chose to use the hook_user_insert() to extend my logic for the entity creation. It fires when a new user is verified and added to the users table/entity.