Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.381
diff -u -p -r1.381 form.inc
--- includes/form.inc	9 Oct 2009 08:12:07 -0000	1.381
+++ includes/form.inc	9 Oct 2009 21:00:36 -0000
@@ -655,19 +655,14 @@ function drupal_prepare_form($form_id, &
   }
 
   $form += element_info('form');
-  $form += array('#tree' => FALSE, '#parents' => array());
+  $form += array('#tree' => FALSE, '#parents' => array(), '#validate' => array(), '#submit' => array());
 
-  if (!isset($form['#validate'])) {
-    if (function_exists($form_id . '_validate')) {
-      $form['#validate'] = array($form_id . '_validate');
-    }
+  // Add default validate and submit handlers so they can be altered.
+  if (function_exists($form_id . '_validate')) {
+    array_unshift($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 (function_exists($form_id . '_submit')) {
+    array_unshift($form['#validate'], $form_id . '_submit');
   }
 
   // Normally, we would call drupal_alter($form_id, $form, $form_state).
@@ -2971,7 +2966,7 @@ function batch_process($redirect = NULL,
   $batch =& batch_get();
 
   drupal_theme_initialize();
-  
+
   if (isset($batch)) {
     // Add process information
     $process_info = array(
@@ -2985,7 +2980,7 @@ function batch_process($redirect = NULL,
     );
     $batch += $process_info;
 
-    // The batch is now completely built. Allow other modules to make changes to the 
+    // The batch is now completely built. Allow other modules to make changes to the
     // batch so that it is easier to reuse batch processes in other enviroments.
     drupal_alter('batch', $batch);
 
