1

During Drupal's normal user registration process (a user registering their own self, as opposed to an admin registering a user) a Civi contact record is created for that user. That works fine but the only data set for the contact record is the email address. How do I set it up so that the contact's First and Last Names are set during that process?

Currently I have fields on the user profile for first and last names. Is there a hook I can use to save these values to the contact record?

I don't see any configuration options for this sort of thing. I'm kind of mystified by the lack of info on this particular use case when I search the web, as it seems like a standard scenario.

  • By default CiviCRM comes with a profile called 'Name and Address' which is set to be used for User Registration. First Name and Last Name fields in this profile are, again by default, set as required fields. So when a site visitor goes to user/register they need not only to provide a username/email address/password, but they also see the fields exposed in the Name and Address profile and must provide First/Last name. Maybe you've disabled or removed this profile? Or you can create a new profile that's used for user registration. – Graham Oct 27 '17 at 9:15
  • Thanks Graham! Indeed, the developer who started this project disabled that default profile; using a profile for user registration does work. As an alternate approach are there hooks available for this sort of thing? – alec Oct 27 '17 at 12:24
  • 1
    And feel free to post an answer for me to accept if you'd like the points :) – alec Oct 27 '17 at 12:25
1

By default CiviCRM comes with a profile called 'Name and Address' which is set to be used for User Registration. First Name and Last Name fields in this profile are, again by default, set as required fields. So when a site visitor goes to user/register they need not only to provide a username/email address/password, but they also see the fields exposed in the Name and Address profile and must provide First/Last name. Maybe you've disabled or removed this profile? Or you can create a new profile that's used for user registration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.