Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.396
diff -u -p -r1.396 form.inc
--- includes/form.inc	8 Nov 2009 19:53:19 -0000	1.396
+++ includes/form.inc	9 Nov 2009 21:33:05 -0000
@@ -618,6 +618,8 @@ function drupal_prepare_form($form_id, &
   global $user;
 
   $form['#type'] = 'form';
+  $form += element_info('form');
+
   $form_state['programmed'] = isset($form_state['programmed']) ? $form_state['programmed'] : FALSE;
 
   if (isset($form['#build_id'])) {
@@ -661,20 +663,13 @@ function drupal_prepare_form($form_id, &
     $form['#id'] = drupal_html_id($form_id);
   }
 
-  $form += element_info('form');
-  $form += array('#tree' => FALSE, '#parents' => array());
-
-  if (!isset($form['#validate'])) {
-    if (function_exists($form_id . '_validate')) {
-      $form['#validate'] = array($form_id . '_validate');
-    }
+  // Add default validate and submit handlers if they exist and have not been
+  // defined already.
+  if (!in_array($form_id . '_validate', $form['#validate']) && function_exists($form_id . '_validate')) {
+    $form['#validate'][] = $form_id . '_validate';
   }
-
-  if (!isset($form['#submit'])) {
-    if (function_exists($form_id . '_submit')) {
-      // We set submit here so that it can be altered.
-      $form['#submit'] = array($form_id . '_submit');
-    }
+  if (!in_array($form_id . '_submit', $form['#submit']) && function_exists($form_id . '_submit')) {
+    $form['#submit'][] = $form_id . '_submit';
   }
 
   // Invoke hook_form_FORM_ID_alter() implementations.
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.838
diff -u -p -r1.838 system.module
--- modules/system/system.module	8 Nov 2009 10:29:23 -0000	1.838
+++ modules/system/system.module	9 Nov 2009 21:31:43 -0000
@@ -296,6 +296,10 @@ function system_element_info() {
     '#method' => 'post',
     '#action' => request_uri(),
     '#theme_wrappers' => array('form'),
+    '#tree' => FALSE,
+    '#parents' => array(),
+    '#validate' => array(),
+    '#submit' => array(),
   );
   $types['page'] = array(
     '#show_messages' => TRUE,
