Index: openid_cp_field.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openid_cp_field/openid_cp_field.module,v
retrieving revision 1.1.2.11
diff -u -p -r1.1.2.11 openid_cp_field.module
--- openid_cp_field.module	23 Apr 2009 19:33:52 -0000	1.1.2.11
+++ openid_cp_field.module	9 Jun 2009 12:16:32 -0000
@@ -212,8 +213,9 @@ function openid_cp_field_map_submit($for
       }
       break;
     case t('Revert'):
-      variable_set('openid_cp_field_map_'. $type, array());
-      variable_set('openid_cp_field_map_'. $type. '_sreg', array());
+      $mapping_imported = module_invoke_all('openid_cp_field_mapping');
+      variable_set('openid_cp_field_map_'. $type, $mapping_imported[$type]);
+      variable_set('openid_cp_field_map_'. $type. '_sreg', $mapping_imported[$type. '_sreg']);
       break;
   }
 }
@@ -374,22 +396,15 @@ function openid_cp_field_openid_client_a
  */
 function openid_cp_field_get_mapping(&$mapping, $type = FALSE) {
   if ($type == FALSE) {
-    global $user;
-    $types = array_keys(content_profile_get_types('names'));
-    foreach ($types as $type) {
-      $profile = content_profile_load($type, $user->uid);
-      if($profile !== FALSE) {
-        break;
-      }
-    }
+    $type = array_shift(array_keys(content_profile_get_types('names')));
   }
   
   $mapping_imported = module_invoke_all('openid_cp_field_mapping');
   $in_variable = variable_get('openid_cp_field_map_'. $type, array());
   if (isset($mapping_imported[$type])) {
     if (is_array($mapping_imported[$type]) && count($mapping_imported[$type]) > 0) {
-      if (count($in_variable) > 0 && $in_variable != $mapping_imported[$type]) {
-        $mapping = variable_get('openid_cp_field_map_'. $type, array());
+      if (is_array($in_variable) && $in_variable != $mapping_imported[$type]) {
+        $mapping = $in_variable;
         return OPENID_CP_FIELD_OVERRIDDEN;
       }
       else {

