I am not sure where to put this bug. I think the include files for node and user import are written by bdragon so I am linking this bug to the location project since the cause starts here.

The Additional field is missing from the field list for user import. I traced the problem back to the location.inc file in the node import support directory. It looks like the the install process for the location module intentionally skips storing a location_fields_additional__$type variable. This causes the location_node_import_fields function to not return the field for either user or node imports because the test to see if the variable is enabled fails.

So I added another test to get the field listed properly. Not sure if this still breaks further down the process or not, but I am reporting the bug while I continue working on it.

From www.example.com/sites/all/modules/node_import/supported/location.inc and this function is also called from .....modules/user_import/supported/location.inc

function location_node_import_fields($type) {
  if (!variable_get('location_maxnum_'. $type, 0)) {
    return;
  }

  $fields = array();
  if (function_exists('location_newapi')) {
    // Location 3.x.
    $settings = _node_import_location_newapi_get_settings($type);
    $names = location_field_names();
    foreach ($settings as $field => $enabled) {
      if ($enabled) {
        $fields['node_import_location_'. $field] = t('Location: @fieldname', array('@fieldname' => $names[$field]));
      }
    }  //add additional back if street is enabled
	if ($fields['node_import_location_street']) $fields['node_import_location_additional'] = t('Location: Additional');
  }
  else {
    // Location 2.x and under.
    foreach ((array)location_field_names() as $field => $fieldname) {
      if (variable_get('location_'. $field .'_'. $type, $field == 'country' ? 1 : 0)) {
        $fields['node_import_location_'. $field] = t('Location: @fieldname', array('@fieldname' => $fieldname));
      }
    }
  }
  if (user_access('submit latitude/longitude')) {
    $fields['node_import_location_latitude'] = t('Location: Latitude');
    $fields['node_import_location_longitude'] = t('Location: Longitude');
  }
  return $fields;
}

Katrina

--
www.ambereyes.net

Comments

bdragon’s picture

Status: Active » Closed (duplicate)