Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.495
diff -u -p -r1.495 form.inc
--- includes/form.inc	24 Sep 2010 21:36:22 -0000	1.495
+++ includes/form.inc	25 Sep 2010 22:09:36 -0000
@@ -2289,8 +2289,8 @@ function _form_options_flatten($array) {
  *   - #required: (optional) Whether the user needs to select an option (TRUE)
  *     or not (FALSE). Defaults to TRUE.
  *   - #empty_option: (optional) The label to show for the first default option.
- *     By default, the label is automatically set to "- Please select -" for a
- *     required field and "- None -" for an optional field.
+ *     If not set, the default label is automatically set according to whether
+ *     the element is #required or not.
  *   - #empty_value: (optional) The value for the first default option, which is
  *     used to determine whether the user submitted a value or not. Defaults to
  *     '' (an empty string). To be used in case the field is optional and the
Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.88
diff -u -p -r1.88 block.admin.inc
--- modules/block/block.admin.inc	24 Sep 2010 21:36:22 -0000	1.88
+++ modules/block/block.admin.inc	25 Sep 2010 22:09:36 -0000
@@ -150,7 +150,9 @@ function block_admin_display_form($form,
     }
   }
   // Do not allow disabling the main system content block.
-  $form['blocks']['system_main']['region']['#required'] = TRUE;
+  if (isset($form['blocks']['system_main']['region'])) {
+    $form['blocks']['system_main']['region']['#required'] = TRUE;
+  }
 
   $form['actions'] = array(
     '#tree' => FALSE,
Index: modules/menu/menu.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v
retrieving revision 1.85
diff -u -p -r1.85 menu.admin.inc
--- modules/menu/menu.admin.inc	24 Sep 2010 21:36:22 -0000	1.85
+++ modules/menu/menu.admin.inc	25 Sep 2010 22:09:36 -0000
@@ -679,7 +679,6 @@ function menu_configure() {
 
   $menu_options = menu_get_menus();
 
-  $main = variable_get('menu_main_links_source', 'main-menu');
   $form['menu_main_links_source'] = array(
     '#type' => 'select',
     '#title' => t('Source for the Main links'),
@@ -688,7 +687,7 @@ function menu_configure() {
     '#empty_option' => t('No Main links'),
     '#options' => $menu_options,
     '#tree' => FALSE,
-    '#description' => t('Select what should be displayed as the Main links (typically at the top of the page).'),
+    '#description' => t('Typically displayed at the top of the page.'),
   );
 
   $form['menu_secondary_links_source'] = array(
@@ -699,7 +698,7 @@ function menu_configure() {
     '#empty_option' => t('No Secondary links'),
     '#options' => $menu_options,
     '#tree' => FALSE,
-    '#description' => t("Select the source for the Secondary links. An advanced option allows you to use the same source for both Main links (currently %main) and Secondary links: if your source menu has two levels of hierarchy, the top level menu links will appear in the Main links, and the children of the active link will appear in the Secondary links." , array('%main' => $main_options[$main])),
+    '#description' => t('Typically displayed as a complement to the Main links, near the top of the page. If you use the same source for the Main links and Secondary links, the Secondary links will change based on which Main link is being visited, and will always display the immediate children of that link.'),
   );
 
   return system_settings_form($form);
Index: modules/simpletest/tests/form.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v
retrieving revision 1.68
diff -u -p -r1.68 form.test
--- modules/simpletest/tests/form.test	24 Sep 2010 21:36:22 -0000	1.68
+++ modules/simpletest/tests/form.test	25 Sep 2010 22:09:36 -0000
@@ -158,14 +158,45 @@ class FormsTestCase extends DrupalWebTes
   function testSelect() {
     $form = $form_state = array();
     $form = form_test_select($form, $form_state);
-    $error = '!name field is required.';
     $this->drupalGet('form-test/select');
 
-    // Posting without any values should throw validation errors.
+    // Verify that the expected options are selected by default.
+    $expected_defaults = array(
+      'select' => 'one',
+      'empty_value' => 'one',
+      'empty_value_one' => 'one',
+      'invalid_default' => '',
+      'invalid_default_optional' => '',
+      'no_default' => '',
+      'no_default_optional' => '',
+      'no_default_empty_option' => '',
+      'no_default_empty_option_optional' => '',
+      'no_default_empty_value' => '',
+      'no_default_empty_value_one' => '',
+      'no_default_empty_value_optional' => 0,
+      'multiple[]' => 'two',
+      'multiple_no_default[]' => NULL,
+      'multiple_no_default_required[]' => NULL,
+    );
+    foreach ($expected_defaults as $key => $value) {
+      $xpath = '//select[@name="' . $key . '"]/option[@selected="selected" and @value="' . $value . '"]';
+      if (isset($value)) {
+        $this->assertFieldByXPath($xpath, NULL, t("@key: Correct option '@value' was pre-selected.", array('@key' => $key, '@value' => $value)));
+      }
+      else {
+        $this->assertNoFieldByXPath($xpath, NULL, t('@key: No option was pre-selected.', array('@key' => $key)));
+      }
+    }
+
+    // Posting without any values should throw validation errors under certain
+    // conditions.
+    $error = '!name field is required.';
     $this->drupalPost(NULL, array(), 'Submit');
     $this->assertNoText(t($error, array('!name' => $form['select']['#title'])));
     $this->assertNoText(t($error, array('!name' => $form['empty_value']['#title'])));
     $this->assertNoText(t($error, array('!name' => $form['empty_value_one']['#title'])));
+    $this->assertText(t($error, array('!name' => $form['invalid_default']['#title'])));
+    $this->assertNoText(t($error, array('!name' => $form['invalid_default_optional']['#title'])));
     $this->assertText(t($error, array('!name' => $form['no_default']['#title'])));
     $this->assertNoText(t($error, array('!name' => $form['no_default_optional']['#title'])));
     $this->assertText(t($error, array('!name' => $form['no_default_empty_option']['#title'])));
@@ -179,6 +210,7 @@ class FormsTestCase extends DrupalWebTes
 
     // Post values for required fields.
     $edit = array(
+      'invalid_default' => 'three',
       'no_default' => 'three',
       'no_default_empty_option' => 'three',
       'no_default_empty_value' => 'three',
@@ -193,6 +225,8 @@ class FormsTestCase extends DrupalWebTes
       'select' => 'one',
       'empty_value' => 'one',
       'empty_value_one' => 'one',
+      'invalid_default' => 'three',
+      'invalid_default_optional' => '',
       'no_default' => 'three',
       'no_default_optional' => '',
       'no_default_empty_option' => 'three',
Index: modules/simpletest/tests/form_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form_test.module,v
retrieving revision 1.49
diff -u -p -r1.49 form_test.module
--- modules/simpletest/tests/form_test.module	24 Sep 2010 21:36:22 -0000	1.49
+++ modules/simpletest/tests/form_test.module	25 Sep 2010 22:09:37 -0000
@@ -815,6 +815,18 @@ function form_test_select($form, &$form_
     '#empty_value' => 'one',
   );
 
+  $form['invalid_default'] = $base + array(
+    '#title' => 'Invalid #default_value',
+    '#default_value' => 'invalid',
+    '#description' => 'Should not pre-select any of the #options, because #default_value does not exist within #options.',
+  );
+  $form['invalid_default_optional'] = $base + array(
+    '#title' => 'Invalid #default_value, not #required',
+    '#required' => FALSE,
+    '#default_value' => 'invalid',
+    '#description' => 'Should pre-select an empty string (default of #empty_value), because #default_value does not exist within #options.',
+  );
+
   $form['no_default'] = $base + array(
     '#title' => 'No #default_value',
   );
Index: modules/trigger/trigger.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v
retrieving revision 1.28
diff -u -p -r1.28 trigger.admin.inc
--- modules/trigger/trigger.admin.inc	24 Sep 2010 21:36:22 -0000	1.28
+++ modules/trigger/trigger.admin.inc	25 Sep 2010 22:09:37 -0000
@@ -180,6 +180,7 @@ function trigger_assign_form($form, $for
     $form[$hook]['parent']['aid'] = array(
       '#type' => 'select',
       '#options' => $options,
+      '#empty_option' => t('- Choose an action -'),
     );
     $form[$hook]['parent']['submit'] = array(
       '#type' => 'submit',
