From 471664d00e278c340208821aa5f789b0bfbdaf8f Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 30 Apr 2012 21:59:29 -0700 Subject: Issue #285232 by ralessi, sun, catch: Add 'please select' item to required select list item. --- modules/profile/profile.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/profile') diff --git a/modules/profile/profile.module b/modules/profile/profile.module index a7ce0116c..6b00d4296 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -435,7 +435,7 @@ function profile_form_alter(&$form, &$form_state, $form_id) { break; case 'selection': - $options = $field->required ? array() : array('--'); + $options = array(); $lines = preg_split("/[\n\r]/", $field->options); foreach ($lines as $line) { if ($line = trim($line)) { @@ -449,6 +449,7 @@ function profile_form_alter(&$form, &$form_state, $form_id) { '#options' => $options, '#description' => _profile_form_explanation($field), '#required' => $field->required, + '#empty_value' => 0, ); break; -- cgit v1.2.3