Index: modules/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile.module,v
retrieving revision 1.130
diff -u -r1.130 profile.module
--- modules/profile.module	25 Jan 2006 08:52:47 -0000	1.130
+++ modules/profile.module	25 Jan 2006 09:25:38 -0000
@@ -367,7 +367,9 @@
         $fields[$category][$field->name] = array('#type' => 'checkbox', '#title' => check_plain($field->title), '#default_value' => $edit[$field->name], '#description' => _profile_form_explanation($field), '#required' => $field->required);
         break;
       case 'selection':
-        $options = array('--');
+        if (!$field->required) {
+          $options = array('--');
+        }
         $lines = split("[,\n\r]", $field->options);
         foreach ($lines as $line) {
           if ($line = trim($line)) {
@@ -477,6 +479,11 @@
   if ($edit['category'] == 'account') {
     form_set_error('category', t('The specified category name is reserved for use by Drupal.'));
   }
+
+  // Validation for a 'selection' field
+  if (($edit['type'] == 'selection') && $edit['required'] && !$edit['options']) {
+    form_set_error('options', t('You must enter selection options.'));
+  }
 }
 
 /**
@@ -566,6 +573,7 @@
 
 function _profile_field_form($type, $edit = array()) {
 
+  $form['type'] = array('#type' => 'hidden', '#value' => $type);
   $form['fields'] = array('#type' => 'fieldset',
     '#title' => t('Field settings'),
   );
