? 835880.patch
Index: uc_signup.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_signup/uc_signup.module,v
retrieving revision 1.60
diff -u -p -r1.60 uc_signup.module
--- uc_signup.module	28 Jul 2010 03:31:01 -0000	1.60
+++ uc_signup.module	21 Aug 2010 13:53:37 -0000
@@ -89,8 +89,15 @@ function uc_signup_requirements($phase) 
  */
 function uc_signup_profile_form() {
   include_once(drupal_get_path('module', 'user') .'/user.pages.inc');
-  $profile_form = array_values(module_invoke('profile', 'user', 'register', array(), (object)array()));
-  return $profile_form;
+  $form = profile_form_profile(array(), (object)array(), NULL, TRUE);
+  // $form now has a fieldset for each profile field category.
+  // We want an array of individual field elements from the first category.
+  $form = array_values($form);
+  $form = $form[0];
+  foreach (element_children($form) as $key => $val) {
+    $new_form[$val] = $form[$val];
+  }
+  return $new_form;
 }
 
 function uc_signup_attendees_form_validate($form, &$form_state) {
@@ -278,7 +285,6 @@ function uc_signup_attendees_form_profil
     if (empty($account->uid)) {
       $profile_form = uc_signup_profile_form();
       if (!empty($profile_form)) {
-        $profile_form = $profile_form[0];
         $form[$mail]['profile'] = $profile_form;
         foreach ($form[$mail]['profile'] as $key => $value) {
           $default = $form_state['values']['profile'][$key .'_'. $mail];
@@ -656,12 +662,9 @@ function uc_signup_order($op, &$arg1, $a
               $form_state['values']['op'] = t('Create new account');
               $form_state['values']['pass'] =  user_password(8);
               $form_state['values']['notify'] = (bool)variable_get('uc_signup_account_notify', 1);
-              $profile_form = array_values(module_invoke('profile', 'user', 'register', array(), (object)array()));
-              $profile_form = $profile_form[0];
+              $profile_form =  uc_signup_profile_form();
               foreach ($profile_form as $key => $value) {
-                if ($key[0] != '#') {
-                  $form_state['values'][$key] = $_SESSION['uc_signup']['profile'][$key .'_'. $mail];
-                }
+                $form_state['values'][$key] = $_SESSION['uc_signup']['profile'][$key .'_'. $mail];
               }
               
               //We masquerade as user 1 in case there is captcha or other protection on the user_register form that could cause submission to fail.
