Index: modules/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile.module,v
retrieving revision 1.132
diff -u -r1.132 profile.module
--- modules/profile.module	30 Jan 2006 18:32:24 -0000	1.132
+++ modules/profile.module	2 Feb 2006 11:11:43 -0000
@@ -369,7 +369,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('<' . t('none') . '>');
+        }
         $lines = split("[,\n\r]", $field->options);
         foreach ($lines as $line) {
           if ($line = trim($line)) {
@@ -479,6 +481,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.'));
+  }
 }
 
 /**
@@ -568,6 +575,7 @@
 
 function _profile_field_form($type, $edit = array()) {
 
+  $form['type'] = array('#type' => 'hidden', '#value' => $type);
   $form['fields'] = array('#type' => 'fieldset',
     '#title' => t('Field settings'),
   );
