Index: modules/civinode/civinode.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/civinode/civinode.module,v
retrieving revision 1.27
diff -u -r1.27 civinode.module
--- modules/civinode/civinode.module	1 Feb 2007 06:42:56 -0000	1.27
+++ modules/civinode/civinode.module	24 Feb 2007 04:39:14 -0000
@@ -282,13 +282,7 @@
  * Default theme for a contact using the specified profile id
  *
  */
-function theme_crm_profile_cid($pid, $cid){
-  $meta_data = civinode_get_profile_metadata($pid, 'view');
-  if (!$meta_data)
-    return ""; //nothing to display.
-
-  //Pull data for our cid
-  $contact = (object)civinode_util_load_cdata($cid, $pid);
+function theme_crm_profile_cid($contact, $pid){
   if (isset($contact->display_name))
     $contact->title = $contact->display_name;

Index: modules/civinode/contrib/civicrmdata/civicrmdata.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/civinode/contrib/civicrmdata/civicrmdata.module,v
retrieving revision 1.8
diff -u -r1.8 civicrmdata.module
--- modules/civinode/contrib/civicrmdata/civicrmdata.module	1 Feb 2007 06:42:56 -0000	1.8
+++ modules/civinode/contrib/civicrmdata/civicrmdata.module	24 Feb 2007 04:39:20 -0000
@@ -91,6 +91,21 @@
   $crm_entity = substr($field['type'], 12);
 
   switch ($op) {
+    case 'load':
+      $pid = 0;
+      if (isset($field['profile_id']))
+        $pid = $field['profile_id'];
+      switch ($crm_entity) {
+        case 'contact':
+        case 'group':
+        foreach ($node_field as $delta => $item) {
+          _civicrmdata_load($node, $crm_entity, $item['crmid'], $pid);
+        }
+        break;
+        
+        default:
+          return;   
+      }
     case 'view':
       $pid = 0;
       if (isset($field['profile_id']))
@@ -99,7 +114,7 @@
         case 'contact':
         case 'group':
         foreach ($node_field as $delta => $item) {
-          $node_field[$delta]['view'] = _civicrmdata_view($crm_entity, $item['crmid'], $pid);
+          $node_field[$delta]['view'] = _civicrmdata_view($node, $crm_entity, $item['crmid'], $pid);
         }
         break;
         
@@ -111,7 +126,7 @@
   }
 }
 
-function _civicrmdata_view($crm_entity, $crm_id, $profile_id = 0) {
+function _civicrmdata_load(&$node, $crm_entity, $crm_id, $profile_id = 0) {
 
   switch($crm_entity) {
     case 'contact':
@@ -119,7 +134,7 @@
       _civicrmdata_includer(); // get our helper functions
       if (!$profile_id)
         $profile_id = civinode_get_default_profile_id($user->uid);
-      return theme('crm_profile_cid', $profile_id, $crm_id);
+      $node->civicrm_contact = (object)civinode_util_load_cdata($crm_id, $profile_id);
     case 'group':
       _civicrmdata_includer(); // get our helper functions
       if (civinode_check_init()) {
@@ -128,7 +143,7 @@
         $groups = crm_get_groups($params, $returns);
         if ($group = array_pop($groups)) {
           // todo: check perms and return to links to viewing the contacts
-          return check_plain($group->title);
+          $node->civicrm_group = $group->title);
         }
       }
       break;   
@@ -136,6 +151,18 @@
   }
 }
 
+function _civicrmdata_view($node, $crm_entity, $crm_id, $pid) {
+
+  switch($crm_entity) {
+    case 'contact':
+      return theme('crm_profile_cid', $node->civicrm_contact, $pid);
+    case 'group':
+      return check_plain($node->civicrm_group);
+      break;   
+      
+  }
+}
+
 /**
  * Implementation of hook_widget_info().
  */
