Index: .buildpath
===================================================================
RCS file: .buildpath
diff -N .buildpath
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .buildpath	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<buildpath>
+	<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
+	<buildpathentry combineaccessrules="false" kind="prj" path="/cck"/>
+	<buildpathentry combineaccessrules="false" kind="prj" path="/drupal"/>
+	<buildpathentry kind="src" path=""/>
+</buildpath>
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .project	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>node_import</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.dltk.core.scriptbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.php.core.PHPNature</nature>
+	</natures>
+</projectDescription>
Index: .settings/org.eclipse.php.core.prefs
===================================================================
RCS file: .settings/org.eclipse.php.core.prefs
diff -N .settings/org.eclipse.php.core.prefs
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .settings/org.eclipse.php.core.prefs	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,3 @@
+#Mon Oct 04 10:01:04 CEST 2010
+eclipse.preferences.version=1
+include_path=0;/node_import\u00052;/cck\u00052;/drupal
Index: node_import.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/Attic/node_import.inc,v
retrieving revision 1.1.2.60
diff -u -r1.1.2.60 node_import.inc
--- node_import.inc	22 Apr 2010 20:28:53 -0000	1.1.2.60
+++ node_import.inc	4 Oct 2010 08:07:11 -0000
@@ -1252,15 +1252,22 @@
  * Uses: $field['output_format']. Either 'nid' (default) or 'title'.
  */
 function node_import_check_node_reference(&$value, $field, $options, $preview) {
-  if (($nid = node_import_get_object('node', $value)) !== NULL ||
-      ($nid = db_result(db_query("SELECT nid FROM {node} WHERE nid = %d OR LOWER(title) = '%s' LIMIT 1", is_numeric($value) && intval($value) > 0 ? $value : -1, drupal_strtolower($value))))) {
+  $references = node_import_node_reference_potential_references($field['referenceable_types'], $value);
+  // fallback: try with ID instead of name
+  if (is_numeric($value) && count($references) == 0) {
+    $references = node_import_node_reference_potential_references($field['referenceable_types'], '', 'contains', array($value));
+  }
 
+  if (count($references) > 0) {
+    $nid_list = array_keys($references);
+    $nid = array_shift($nid_list);
     node_import_set_object('node', $value, $nid);
     $value = $nid;
 
     $field['output_format'] = isset($field['output_format']) ? $field['output_format'] : 'nid';
     switch ($field['output_format']) {
       case 'title':
+      case 'name':
         if (($title = node_import_get_object('node:title', $nid)) ||
             ($title = db_result(db_query("SELECT title FROM {node} WHERE nid = %d LIMIT 1", $nid)))) {
           $value = $title;
@@ -1281,6 +1288,57 @@
 }
 
 /**
+ * referenceable nodes defined by content types.
+ *
+ * Almost a copy of cck nodereference _nodereference_potential_references_standard().
+ */
+function node_import_node_reference_potential_references($referenceable_types, $string = '', $match = 'contains', $ids = array(), $limit = NULL) {
+  $related_types = array();
+  $where = array();
+  $args = array();
+
+  if (is_array($referenceable_types)) {
+    foreach (array_filter($referenceable_types) as $related_type) {
+      $related_types[] = "n.type = '%s'";
+      $args[] = $related_type;
+    }
+  }
+
+  $where[] = implode(' OR ', $related_types);
+
+  if (!count($related_types)) {
+    return array();
+  }
+
+  if ($string !== '') {
+    $match_operators = array(
+      'contains' => "LIKE '%%%s%%'",
+      'equals' => "= '%s'",
+      'starts_with' => "LIKE '%s%%'",
+    );
+    $where[] = 'n.title '. (isset($match_operators[$match]) ? $match_operators[$match] : $match_operators['contains']);
+    $args[] = $string;
+  }
+  elseif ($ids) {
+    $where[] = 'n.nid IN (' . db_placeholders($ids) . ')';
+    $args = array_merge($args, $ids);
+  }
+
+  $where_clause = $where ? 'WHERE ('. implode(') AND (', $where) .')' : '';
+  $sql = db_rewrite_sql("SELECT n.nid, n.title AS node_title, n.type AS node_type FROM {node} n $where_clause ORDER BY n.title, n.type");
+  $result = $limit ? db_query_range($sql, $args, 0, $limit) : db_query($sql, $args);
+  $references = array();
+  while ($node = db_fetch_object($result)) {
+    $references[$node->nid] = array(
+      'title' => $node->node_title,
+      'rendered' => check_plain($node->node_title),
+    );
+  }
+
+  return $references;
+}
+
+/**
  * Check if the value is a valid user (by uid, name or email).
  *
  * Uses: $field['output_format']. Either 'uid' (default), 'name' or 'email'.
Index: supported/cck/nodereference.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/supported/cck/Attic/nodereference.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 nodereference.inc
--- supported/cck/nodereference.inc	14 Apr 2009 06:32:02 -0000	1.1.2.2
+++ supported/cck/nodereference.inc	4 Oct 2010 08:07:11 -0000
@@ -24,6 +24,7 @@
           $fields[$cck_fieldname]['input_format'] = 'node_reference';
           $fields[$cck_fieldname]['output_format'] = ($fieldinfo['widget']['type'] == 'nodereference_autocomplete' ? 'name' : 'nid');
           $fields[$cck_fieldname]['map_required'] = $fieldinfo['required'];
+          $fields[$cck_fieldname]['referenceable_types'] = $fieldinfo['referenceable_types'];
           break;
 
         default:
