Im running into some difficulty with hook_user_import_form_field_match() I have implemented it and have the option i want in my drop down. But upon running an import i dump the $account variable from hook_user_import_pre_save() and my option exists, but the array is empty. Im just working off of the sample.txt file, so i know there is good data in there.

here is my code

function resync_user_import_form_field_match() {
	$options['resync']['member_expire'] = "Membership expiration date";
	return $options;
}

/*
 * Implementation of hook_user_import_pre_save
 */
function resync_user_import_pre_save($settings, $account, $fields, $errors) {
	dvm($account);
	dvm($fields);
}

which produces the following var_dump

array(2) {
  ["user"]=>
  array(2) {
    ["password"]=>
    array(1) {
      [0]=>
      string(10) "First Name"
    }
    ["email"]=>
    array(1) {
      [0]=>
      string(5) "Email"
    }
  }
  ["resync"]=>
  array(1) {
    ["member_expire"]=>
    array(0) {
    }
  }
}

Comments

cangeceiro’s picture

Status: Active » Closed (fixed)

Found my problem. You must declare hook_user_import_data and return data