Index: civinode_utils.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/civinode/civinode_utils.inc,v
retrieving revision 1.23.2.4
diff -u -r1.23.2.4 civinode_utils.inc
--- civinode_utils.inc	17 Feb 2007 01:16:41 -0000	1.23.2.4
+++ civinode_utils.inc	24 Feb 2007 03:47:45 -0000
@@ -398,14 +398,20 @@
     return NULL;
   }
   $params = array('contact_id' => $cid);
-  $keys = civinode_get_profile_field_list($pid, 'view');
-  foreach ($keys as $key => $full_key) {
-    $return_items[$key] = 1;
+  if ($pid) {
+    $return_properties = array();
+    $keys = civinode_get_profile_field_list($pid, 'view');
+    foreach (array_keys($keys) as $key) {
+      $return_properties[$key] = 1;
+    }
+  }
+  else {
+    $return_properties = NULL;
   }
   //TO DO: add profile filter
-  $data = crm_fetch_contact($params);
+  $data = crm_fetch_contact($params, $return_properties);
 /*  //Work around for CRM-822
-  $contacts = crm_contact_search($params);
+  $contacts = crm_contact_search($params, $return_properties);
   //this is also counter to spec:
   if(!isset($contacts[0][$cid]))
     return array();
@@ -631,7 +637,6 @@
   return array_keys($group_list);
 }
 
-
 /**
  * Determines if a CRM group contains a contact.
  *
