1

We have an online training platform and had created custom first and last name fields to be used on their training certificates. Drupal asks for this information when they register for an account. However, this first and last name is not passed on to CiviCRM until they fill it out again during the subscription process.

How can I synchronize the first and last name fields in CiviCRM with the custom first and last name fields I created in Drupal? Thanks!

CiviCRM 4.7.15, Drupal 7

1 Answer 1

1

My answer is an alternative that was used in order to accomplish what was needed. Rather than sync Drupal fields with CiviCRM fields, I activated the ability for CiviCRM fields to be used in Drupal views, as well as created custom profiles in CiviCRM to render the fields during the Drupal registration process. Please go ahead an add an answer if it answers the original question.

  1. Go to http://yourdomain.com/civicrm/admin/setting/uf?reset=1, replacing "yourdomain.com" with your actual domain. Copy all the code shown.
  2. Edit your settings.php file and insert the code after the databases array, so it will look something like this:

    $databases = array (
      'default' =>
      array (
        'default' =>
        array (
          'database' => 'drupal',
          'username' => 'user',
          'password' => 'password',
          'host' => 'localhost',
          'port' => '',
          'driver' => 'mysql',
          'prefix' => '',
        ),
      ),
    );
    

    /* Beginning of pasted code from CiviCRM */

  3. Clear site caches and civicrm caches and you should be able to render CiviCRM fields in your Drupal views.

Source: https://docs.civicrm.org/sysadmin/en/latest/integration/drupal/views/ (Updated, thanks Aiden)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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