Drupal Version 7.21

I tried to import a csv file.
the CSV columns are OK
The Pulldown list "Drupal Fileds" is containing only: ------------; email; password; roles;
The Pulldown list "Username" is containing only: ---; 1; 2; 3; 4;

Kind Regards Knut

Comments

davidwhthomas’s picture

Similar issue here, the select field to map the CSV column to Drupal fields doesn't include the username field.

So, it's not possible to map a field to the username.

I see "Username" is commented out in user.inc


/**
 * Implementation of hook_user_import_form_field_match().
 */
function user_user_import_form_field_match() {
  $options                     = array();
  $options['user']['email']    = t('Email Address*');
  $options['user']['password'] = t('Password');
  $options['user']['roles']    = t('Roles');

  // $options['user']['username'] = t('Username');
  // $options['user']['uid'] = t('UID');
  // $options['user']['modified'] = t('Modified');
  // $options['user']['picture_uri'] = t('Picture');
  // $options['user']['timezone'] = t('Timezone');
  // $options['user']['md5_password'] = t('Password MD5');

  return $options;
}

Uncommenting it provides the username field, but doesn't map any data to it after import ( and username is randomly generated instead )

davidwhthomas’s picture

Status: Active » Closed (works as designed)

OK, I see the workflow is a bit "special" for username. It's not selected from the drop down box ( like email address, password etc..), but rather the admin is expected to select "1" from the drop down box if that field is the first part of the username etc...

After selecting "1" for the relevant field ( and leaving the drop down at "-------------"), the import was successful, thanks.