? nr_nid.patch
Index: node_reference.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/modules/node_reference/node_reference.module,v
retrieving revision 1.18
diff -u -p -r1.18 node_reference.module
--- node_reference.module	7 Dec 2009 23:57:57 -0000	1.18
+++ node_reference.module	8 Dec 2009 07:23:24 -0000
@@ -381,7 +381,7 @@ function node_reference_autocomplete_val
  * Validate an autocomplete element.
  */
 function node_reference_autocomplete_validate($element, &$form_state, $form) {
-  $value = $element['#value']['nid'];
+  $value = $element['#value'];
   $nid = NULL;
   if (!empty($value)) {
     $field_name = $element['#field_name'];
@@ -391,7 +391,7 @@ function node_reference_autocomplete_val
       // Explicit [nid:n].
       list(, $title, $nid) = $matches;
       if (!empty($title) && ($n = node_load($nid)) && $title != $n->title[LANGUAGE_NONE][0]['value']) {
-        form_error($element['nid'], t('%name: title mismatch. Please check your selection.', array('%name' => t($instance['label']))));
+        form_error($element, t('%name: title mismatch. Please check your selection.', array('%name' => t($instance['label']))));
       }
     }
     else {
@@ -399,7 +399,7 @@ function node_reference_autocomplete_val
       $field = field_info_field($field_name);
       $reference = _node_reference_potential_references($field, $value, 'equals', NULL, 1);
       if (empty($reference)) {
-        form_error($element['nid'], t('%name: found no valid post with that title.', array('%name' => t($instance['label']))));
+        form_error($element, t('%name: found no valid post with that title.', array('%name' => t($instance['label']))));
       }
       else {
         // TODO: the best thing would be to present the user with an
