Index: uc_signup.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_signup/uc_signup.module,v
retrieving revision 1.55
diff -u -p -r1.55 uc_signup.module
--- uc_signup.module	28 Apr 2010 22:40:15 -0000	1.55
+++ uc_signup.module	28 Apr 2010 23:19:52 -0000
@@ -61,6 +61,38 @@ function uc_signup_theme() {
   );
 }
 
+/*
+ * Implementation of hook_requirements().
+ */
+
+function uc_signup_requirements($phase) {
+  if ($phase == 'runtime') {
+    $requirements['uc_signup']['title'] = t('Signup Integration for Ubercart');
+    $profile_form = array_values(module_invoke('profile', 'user', 'register', array(), (object)array()));
+    if (empty($profile_form)) {
+      $requirements['uc_signup']['description'] = t('You have no core user
+        profile fields that are configured to show on the user registration form.
+        UC_Signup requires that you make at !action',
+        array('!action' => l(t('set at least one profile field to appear on the registration form.'), 'admin/user/profile')));
+      $requirements['uc_signup']['severity'] = REQUIREMENT_WARNING;
+    }
+    else {
+      $requirements['uc_signup']['description'] = t('You have at least one core profile field set to show up on the user registration form.');
+      $requirements['uc_signup']['severity'] = REQUIREMENT_OK;
+    }
+  }
+  return $requirements;
+}
+
+/*
+ * Get the profile fields required on user registration.
+ */
+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;
+}
+
 function uc_signup_attendees_form_validate($form, &$form_state) {
   if ($form_state['storage']['step'] == 'emails') {
     foreach ($form_state['values'] as $key => $value) {
@@ -226,8 +258,7 @@ function uc_signup_attendees_form_profil
     }
   }
 
-  include_once(drupal_get_path('module', 'user') .'/user.pages.inc');
-  $profile_form = array_values(module_invoke('profile', 'user', 'register', array(), (object)array()));
+  $profile_form = uc_signup_profile_form();
   $mail = '';
   foreach ($mails as $mail => $events) {
     $form[$mail] = array(
@@ -245,7 +276,7 @@ function uc_signup_attendees_form_profil
     // Is there an account for this email address?
     $account = user_load(array('mail' => $mail));
     if (empty($account->uid)) {
-      $profile_form = array_values(module_invoke('profile', 'user', 'register', array(), (object)array()));
+      $profile_form = uc_signup_profile_form;
       if (!empty($profile_form)) {
         $profile_form = $profile_form[0];
         $form[$mail]['profile'] = $profile_form;
