Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.208
diff -u -p -r1.208 install.php
--- install.php	17 Sep 2009 02:34:32 -0000	1.208
+++ install.php	17 Sep 2009 02:48:43 -0000
@@ -801,7 +801,7 @@ function install_verify_settings() {
  * @return
  *   The form API definition for the database configuration form.
  */
-function install_settings_form(&$form_state, &$install_state) {
+function install_settings_form($form, &$form_state, &$install_state) {
   global $databases, $db_prefix;
   $profile = $install_state['parameters']['profile'];
   $install_locale = $install_state['parameters']['locale'];
@@ -1069,7 +1069,7 @@ function _install_select_profile($profil
  * @param $profile_files
  *   Array of .profile files, as returned from file_scan_directory().
  */
-function install_select_profile_form(&$form_state, $profile_files) {
+function install_select_profile_form($form, &$form_state, $profile_files) {
   $profiles = array();
   $names = array();
 
@@ -1205,7 +1205,7 @@ function install_select_locale(&$install
 /**
  * Form API array definition for language selection.
  */
-function install_select_locale_form(&$form_state, $locales) {
+function install_select_locale_form($form, &$form_state, $locales) {
   include_once DRUPAL_ROOT . '/includes/iso.inc';
   $languages = _locale_get_predefined_list();
   foreach ($locales as $locale) {
@@ -1337,7 +1337,7 @@ function install_import_locales(&$instal
  * @return
  *   The form API definition for the site configuration form.
  */
-function install_configure_form(&$form_state, &$install_state) {
+function install_configure_form($form, &$form_state, &$install_state) {
   if (variable_get('site_name', FALSE) || variable_get('site_mail', FALSE)) {
     // Site already configured: This should never happen, means re-running the
     // installer, possibly by an attacker after the 'install_task' variable got
@@ -1382,7 +1382,7 @@ function install_configure_form(&$form_s
   drupal_get_schema(NULL, TRUE);
 
   // Return the form.
-  return _install_configure_form($form_state, $install_state);
+  return _install_configure_form($form, $form_state, $install_state);
 }
 
 /**
@@ -1535,7 +1535,7 @@ function install_check_requirements($ins
 /**
  * Form API array definition for site configuration.
  */
-function _install_configure_form(&$form_state, &$install_state) {
+function _install_configure_form($form, &$form_state, &$install_state) {
   include_once DRUPAL_ROOT . '/includes/locale.inc';
 
   $form['site_information'] = array(
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.372
diff -u -p -r1.372 form.inc
--- includes/form.inc	11 Sep 2009 04:09:26 -0000	1.372
+++ includes/form.inc	17 Sep 2009 03:54:15 -0000
@@ -95,7 +95,6 @@ function drupal_get_form($form_id) {
  *   An array which stores information about the form. This is passed as a
  *   reference so that the caller can use it to examine what the form changed
  *   when the form submission process is complete.
- *
  *   The following parameters may be set in $form_state to affect how the form
  *   is rendered:
  *   - args: An array of arguments to pass to the form builder.
@@ -117,6 +116,12 @@ function drupal_get_form($form_id) {
  *     times when a form is resubmitted internally and should be validated
  *     again. Setting this to TRUE will force that to happen. This is most
  *     likely to occur during AHAH or AJAX operations.
+ *   - wrapper_callback: Modules that wish to pre-populate certain forms with
+ *     common elements, such as back/next/save buttons in multi-step form
+ *     wizards, may define a form builder function name that returns a form
+ *     structure, which is passed on to the actual form builder function.
+ *     Such forms cannot use drupal_get_form() and need to prepare $form_state
+ *     on their own.
  * @return
  *   The rendered form or NULL, depending upon the $form_state flags that were set.
  */
@@ -464,10 +469,21 @@ function drupal_retrieve_form($form_id, 
     }
   }
 
- // We need to pass $form_state by reference in order for forms to modify it,
- // since call_user_func_array() requires that referenced variables be passed
- // explicitly.
-  $args = array_merge(array(&$form_state), $args);
+  // When the passed $form_state (not using drupal_get_form()) defines a
+  // 'wrapper_callback', then it requests to invoke a separate (wrapping) form
+  // builder function to pre-populate the $form array with form elements, which
+  // the actual form builder function ($callback) expects. This allows for
+  // pre-populating a form with common elements for certain forms, such as
+  // back/next/save buttons in multi-step form wizards.
+  // @see drupal_build_form()
+  $form = array();
+  if (isset($form_state['wrapper_callback']) && function_exists($form_state['wrapper_callback'])) {
+    $form = $form_state['wrapper_callback']($form, $form_state);
+  }
+  // We need to pass $form_state by reference in order for forms to modify it,
+  // since call_user_func_array() requires that referenced variables be passed
+  // explicitly.
+  $args = array_merge(array($form, &$form_state), $args);
 
   // If $callback was returned by a hook_forms() implementation, call it.
   // Otherwise, call the function named after the form id.
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.226
diff -u -p -r1.226 locale.inc
--- includes/locale.inc	22 Aug 2009 14:34:17 -0000	1.226
+++ includes/locale.inc	10 Sep 2009 04:24:42 -0000
@@ -210,7 +210,7 @@ function locale_languages_custom_form() 
  * @param $langcode
  *   Language code of the language to edit.
  */
-function locale_languages_edit_form(&$form_state, $langcode) {
+function locale_languages_edit_form($form, &$form_state, $langcode) {
   if ($language = db_query("SELECT * FROM {languages} WHERE language = :language", array(':language' => $langcode))->fetchObject()) {
     $form = array();
     _locale_languages_common_controls($form, $language);
@@ -406,7 +406,7 @@ function locale_languages_edit_form_subm
 /**
  * User interface for the language deletion confirmation screen.
  */
-function locale_languages_delete_form(&$form_state, $langcode) {
+function locale_languages_delete_form($form, &$form_state, $langcode) {
 
   // Do not allow deletion of English locale.
   if ($langcode == 'en') {
@@ -816,7 +816,7 @@ function locale_translate_export_screen(
  * @param $names
  *   An associate array with localized language names
  */
-function locale_translate_export_po_form(&$form_state, $names) {
+function locale_translate_export_po_form($form, &$form_state, $names) {
   $form['export'] = array('#type' => 'fieldset',
     '#title' => t('Export translation'),
     '#collapsible' => TRUE,
@@ -881,7 +881,7 @@ function locale_translate_export_po_form
 /**
  * User interface for string editing.
  */
-function locale_translate_edit_form(&$form_state, $lid) {
+function locale_translate_edit_form($form, &$form_state, $lid) {
   // Fetch source string, if possible.
   $source = db_query('SELECT source, context, textgroup, location FROM {locales_source} WHERE lid = :lid', array(':lid' => $lid))->fetchObject();
   if (!$source) {
@@ -1051,7 +1051,7 @@ function locale_translate_delete_page($l
 /**
  * User interface for the string deletion confirmation screen.
  */
-function locale_translate_delete_form(&$form_state, $source) {
+function locale_translate_delete_form($form, &$form_state, $source) {
   $form['lid'] = array('#type' => 'value', '#value' => $source->lid);
   return confirm_form($form, t('Are you sure you want to delete the string "%source"?', array('%source' => $source->source)), 'admin/config/regional/translate/translate', t('Deleting the string will remove all translations of this string in all languages. This action cannot be undone.'), t('Delete'), t('Cancel'));
 }
Index: modules/aggregator/aggregator.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v
retrieving revision 1.42
diff -u -p -r1.42 aggregator.admin.inc
--- modules/aggregator/aggregator.admin.inc	24 Aug 2009 17:11:41 -0000	1.42
+++ modules/aggregator/aggregator.admin.inc	10 Sep 2009 04:24:42 -0000
@@ -58,7 +58,7 @@ function aggregator_view() {
  * @see aggregator_form_feed_validate()
  * @see aggregator_form_feed_submit()
  */
-function aggregator_form_feed(&$form_state, stdClass $feed = NULL) {
+function aggregator_form_feed($form, &$form_state, stdClass $feed = NULL) {
   $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
   $period[AGGREGATOR_CLEAR_NEVER] = t('Never');
 
@@ -196,7 +196,7 @@ function aggregator_form_feed_submit($fo
   }
 }
 
-function aggregator_admin_remove_feed($form_state, $feed) {
+function aggregator_admin_remove_feed($form, $form_state, $feed) {
   return confirm_form(
     array(
       'feed' => array(
@@ -230,7 +230,7 @@ function aggregator_admin_remove_feed_su
  * @see aggregator_form_opml_validate()
  * @see aggregator_form_opml_submit()
  */
-function aggregator_form_opml(&$form_state) {
+function aggregator_form_opml($form, &$form_state) {
   $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
 
   $form['upload'] = array(
@@ -390,7 +390,7 @@ function aggregator_admin_refresh_feed($
  *
  * @ingroup forms
  */
-function aggregator_admin_form($form_state) {
+function aggregator_admin_form($form, $form_state) {
   // Make sure configuration is sane.
   aggregator_sanitize_configuration();
 
@@ -496,7 +496,7 @@ function aggregator_admin_form_submit($f
  * @see aggregator_form_category_validate()
  * @see aggregator_form_category_submit()
  */
-function aggregator_form_category(&$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL)) {
+function aggregator_form_category($form, &$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL)) {
   $form['title'] = array('#type' => 'textfield',
     '#title' => t('Title'),
     '#default_value' => $edit['title'],
Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.55
diff -u -p -r1.55 block.admin.inc
--- modules/block/block.admin.inc	11 Sep 2009 02:12:42 -0000	1.55
+++ modules/block/block.admin.inc	11 Sep 2009 16:55:47 -0000
@@ -25,7 +25,7 @@ function block_admin_display($theme = NU
 /**
  * Generate main blocks administration form.
  */
-function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
+function block_admin_display_form($form, &$form_state, $blocks, $theme = NULL) {
   global $theme_key, $custom_theme;
 
   drupal_add_css(drupal_get_path('module', 'block') . '/block.css', array('preprocess' => FALSE));
@@ -155,7 +155,7 @@ function _block_compare($a, $b) {
 /**
  * Menu callback; displays the block configuration form.
  */
-function block_admin_configure(&$form_state, $module = NULL, $delta = 0) {
+function block_admin_configure($form, &$form_state, $module = NULL, $delta = 0) {
   $form['module'] = array(
     '#type' => 'value',
     '#value' => $module,
@@ -406,8 +406,8 @@ function block_admin_configure_submit($f
 /**
  * Menu callback: display the custom block addition form.
  */
-function block_add_block_form(&$form_state) {
-  return block_admin_configure($form_state, 'block', NULL);
+function block_add_block_form($form, &$form_state) {
+  return block_admin_configure($form, $form_state, 'block', NULL);
 }
 
 function block_add_block_form_validate($form, &$form_state) {
@@ -489,7 +489,7 @@ function block_add_block_form_submit($fo
 /**
  * Menu callback; confirm deletion of custom blocks.
  */
-function block_custom_block_delete(&$form_state, $bid = 0) {
+function block_custom_block_delete($form, &$form_state, $bid = 0) {
   $custom_block = block_custom_block_get($bid);
   $form['info'] = array('#type' => 'hidden', '#value' => $custom_block['info'] ? $custom_block['info'] : $custom_block['title']);
   $form['bid'] = array('#type' => 'hidden', '#value' => $bid);
Index: modules/book/book.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.admin.inc,v
retrieving revision 1.21
diff -u -p -r1.21 book.admin.inc
--- modules/book/book.admin.inc	22 Aug 2009 14:34:18 -0000	1.21
+++ modules/book/book.admin.inc	10 Sep 2009 04:24:42 -0000
@@ -77,7 +77,7 @@ function book_admin_settings_validate($f
  *
  * @ingroup forms.
  */
-function book_admin_edit($form_state, $node) {
+function book_admin_edit($form, $form_state, $node) {
   drupal_set_title($node->title);
   $form = array();
   $form['#node'] = $node;
Index: modules/book/book.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.pages.inc,v
retrieving revision 1.15
diff -u -p -r1.15 book.pages.inc
--- modules/book/book.pages.inc	17 Aug 2009 07:12:15 -0000	1.15
+++ modules/book/book.pages.inc	10 Sep 2009 04:24:42 -0000
@@ -102,7 +102,7 @@ function book_outline($node) {
  *
  * @ingroup forms
  */
-function book_outline_form(&$form_state, $node) {
+function book_outline_form($form, &$form_state, $node) {
   if (!isset($node->book)) {
     // The node is not part of any book yet - set default options.
     $node->book = _book_link_defaults($node->nid);
@@ -186,7 +186,7 @@ function book_outline_form_submit($form,
  *
  * @ingroup forms
  */
-function book_remove_form(&$form_state, $node) {
+function book_remove_form($form, &$form_state, $node) {
   $form['#node'] = $node;
   $title = array('%title' => $node->title);
 
Index: modules/color/color.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/color/color.module,v
retrieving revision 1.71
diff -u -p -r1.71 color.module
--- modules/color/color.module	15 Sep 2009 17:10:39 -0000	1.71
+++ modules/color/color.module	17 Sep 2009 02:48:44 -0000
@@ -39,7 +39,7 @@ function color_form_system_theme_setting
       '#attributes' => array('id' => 'color_scheme_form'),
       '#theme' => 'color_scheme_form',
     );
-    $form['color'] += color_scheme_form($form_state, arg(3));
+    $form['color'] += color_scheme_form($form, $form_state, $form_state['args'][0]);
     $form['#submit'][] = 'color_scheme_form_submit';
   }
 }
@@ -139,7 +139,8 @@ function color_get_palette($theme, $defa
 /**
  * Form callback. Returns the configuration form.
  */
-function color_scheme_form(&$form_state, $theme) {
+function color_scheme_form($form, &$form_state, $theme) {
+  $form = array();
   $base = drupal_get_path('module', 'color');
   $info = color_get_info($theme);
 
@@ -195,7 +196,7 @@ function color_scheme_form(&$form_state,
       '#size' => 8,
     );
   }
-  $form['theme'] = array('#type' => 'value', '#value' => arg(3));
+  $form['theme'] = array('#type' => 'value', '#value' => $theme);
   $form['info'] = array('#type' => 'value', '#value' => $info);
 
   return $form;
Index: modules/comment/comment.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.admin.inc,v
retrieving revision 1.31
diff -u -p -r1.31 comment.admin.inc
--- modules/comment/comment.admin.inc	25 Aug 2009 10:27:14 -0000	1.31
+++ modules/comment/comment.admin.inc	11 Sep 2009 18:43:50 -0000
@@ -34,7 +34,7 @@ function comment_admin($type = 'new') {
  * @see comment_admin_overview_submit()
  * @see theme_comment_admin_overview()
  */
-function comment_admin_overview($type = 'new', $arg) {
+function comment_admin_overview($form, &$form_state, $arg) {
   // Build an 'Update options' form.
   $form['options'] = array(
     '#type' => 'fieldset',
@@ -159,7 +159,7 @@ function comment_admin_overview_submit($
  * @ingroup forms
  * @see comment_multiple_delete_confirm_submit()
  */
-function comment_multiple_delete_confirm(&$form_state) {
+function comment_multiple_delete_confirm($form, &$form_state) {
   $edit = $form_state['input'];
 
   $form['comments'] = array(
@@ -232,7 +232,7 @@ function comment_delete_page($cid = NULL
  * @ingroup forms
  * @see comment_confirm_delete_submit()
  */
-function comment_confirm_delete(&$form_state, $comment) {
+function comment_confirm_delete($form, &$form_state, $comment) {
   $form = array();
   $form['#comment'] = $comment;
   return confirm_form(
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.769
diff -u -p -r1.769 comment.module
--- modules/comment/comment.module	11 Sep 2009 13:37:52 -0000	1.769
+++ modules/comment/comment.module	11 Sep 2009 16:55:47 -0000
@@ -1616,7 +1616,7 @@ function comment_get_display_page($cid, 
  * @see comment_form_validate()
  * @see comment_form_submit()
  */
-function comment_form(&$form_state, $comment) {
+function comment_form($form, &$form_state, $comment) {
   global $user;
 
   $op = isset($_POST['op']) ? $_POST['op'] : '';
Index: modules/contact/contact.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.admin.inc,v
retrieving revision 1.14
diff -u -p -r1.14 contact.admin.inc
--- modules/contact/contact.admin.inc	19 Aug 2009 12:56:47 -0000	1.14
+++ modules/contact/contact.admin.inc	10 Sep 2009 04:24:42 -0000
@@ -39,7 +39,7 @@ function contact_admin_categories() {
 /**
  * Category edit page.
  */
-function contact_admin_edit($form_state = array(), $op, $contact = NULL) {
+function contact_admin_edit($form, $form_state = array(), $op, $contact = NULL) {
 
   if (empty($contact) || $op == 'add') {
     $contact = array(
@@ -138,7 +138,7 @@ function contact_admin_edit_submit($form
 /**
  * Category delete page.
  */
-function contact_admin_delete(&$form_state, $contact) {
+function contact_admin_delete($form, &$form_state, $contact) {
 
   $form['contact'] = array(
     '#type' => 'value',
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.23
diff -u -p -r1.23 contact.pages.inc
--- modules/contact/contact.pages.inc	20 Jul 2009 18:51:33 -0000	1.23
+++ modules/contact/contact.pages.inc	10 Sep 2009 04:24:42 -0000
@@ -171,7 +171,7 @@ function contact_personal_page($account)
 /**
  * Form builder; the personal contact form.
  */
-function contact_personal_form(&$form_state, $recipient) {
+function contact_personal_form($form, &$form_state, $recipient) {
   global $user;
   $form['#token'] = $user->name . $user->mail;
   $form['recipient'] = array('#type' => 'value', '#value' => $recipient);
Index: modules/dblog/dblog.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v
retrieving revision 1.29
diff -u -p -r1.29 dblog.admin.inc
--- modules/dblog/dblog.admin.inc	25 Aug 2009 10:27:14 -0000	1.29
+++ modules/dblog/dblog.admin.inc	11 Sep 2009 18:46:23 -0000
@@ -274,7 +274,7 @@ function _dblog_format_message($dblog) {
  * @see dblog_filter_form_submit()
  * @see dblog_filter_form_validate()
  */
-function dblog_filter_form() {
+function dblog_filter_form($form) {
   $filters = dblog_filters();
 
   $form['filters'] = array(
@@ -347,7 +347,7 @@ function dblog_filter_form_submit($form,
  * @ingroup forms
  * @see dblog_clear_log_submit()
  */
-function dblog_clear_log_form() {
+function dblog_clear_log_form($form) {
   $form['dblog_clear'] = array(
     '#type' => 'fieldset',
     '#title' => t('Clear log messages'),
@@ -367,7 +367,7 @@ function dblog_clear_log_form() {
 /**
  * Submit callback: clear database with log messages.
  */
-function dblog_clear_log_submit(&$form_state, $form) {
+function dblog_clear_log_submit() {
   db_delete('watchdog')->execute();
   drupal_set_message(t('Database log cleared.'));
 }
Index: modules/field_ui/field_ui.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v
retrieving revision 1.13
diff -u -p -r1.13 field_ui.admin.inc
--- modules/field_ui/field_ui.admin.inc	10 Sep 2009 22:31:58 -0000	1.13
+++ modules/field_ui/field_ui.admin.inc	11 Sep 2009 16:56:58 -0000
@@ -65,7 +65,7 @@ function field_ui_inactive_message($bund
  *
  * Allows fields and pseudo-fields to be re-ordered.
  */
-function field_ui_field_overview_form(&$form_state, $obj_type, $bundle) {
+function field_ui_field_overview_form($form, &$form_state, $obj_type, $bundle) {
   $bundle = field_extract_bundle($obj_type, $bundle);
 
   field_ui_inactive_message($bundle);
@@ -550,7 +550,7 @@ function field_ui_field_overview_form_su
  * This form includes form widgets to select which fields appear in teaser and
  * full build modes, and how the field labels should be rendered.
  */
-function field_ui_display_overview_form(&$form_state, $obj_type, $bundle, $build_modes_selector = 'basic') {
+function field_ui_display_overview_form($form, &$form_state, $obj_type, $bundle, $build_modes_selector = 'basic') {
   $bundle = field_extract_bundle($obj_type, $bundle);
 
   field_ui_inactive_message($bundle);
@@ -790,7 +790,7 @@ function field_ui_field_has_data($field)
 /**
  * Menu callback; presents the field settings edit page.
  */
-function field_ui_field_settings_form(&$form_state, $obj_type, $bundle, $instance) {
+function field_ui_field_settings_form($form, &$form_state, $obj_type, $bundle, $instance) {
   $bundle = field_extract_bundle($obj_type, $bundle);
   $field = field_info_field($instance['field_name']);
 
@@ -887,7 +887,7 @@ function field_ui_field_settings_form_su
 /**
  * Menu callback; select a widget for the field.
  */
-function field_ui_widget_type_form(&$form_state, $obj_type, $bundle, $instance) {
+function field_ui_widget_type_form($form, &$form_state, $obj_type, $bundle, $instance) {
   $bundle = field_extract_bundle($obj_type, $bundle);
   $field = field_read_field($instance['field_name']);
 
@@ -946,7 +946,7 @@ function field_ui_widget_type_form_submi
 /**
  * Menu callback; present a form for removing a field from a content type.
  */
-function field_ui_field_delete_form(&$form_state, $obj_type, $bundle, $instance) {
+function field_ui_field_delete_form($form, &$form_state, $obj_type, $bundle, $instance) {
   $bundle = field_extract_bundle($obj_type, $bundle);
   $field = field_info_field($instance['field_name']);
   $admin_path = _field_ui_bundle_admin_path($bundle);
@@ -1000,7 +1000,7 @@ function field_ui_field_delete_form_subm
 /**
  * Menu callback; presents the field instance edit page.
  */
-function field_ui_field_edit_form(&$form_state, $obj_type, $bundle, $instance) {
+function field_ui_field_edit_form($form, &$form_state, $obj_type, $bundle, $instance) {
   $bundle = field_extract_bundle($obj_type, $bundle);
 
   $field = field_info_field($instance['field_name']);
Index: modules/file/tests/file_module_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/tests/file_module_test.module,v
retrieving revision 1.1
diff -u -p -r1.1 file_module_test.module
--- modules/file/tests/file_module_test.module	29 Aug 2009 12:52:32 -0000	1.1
+++ modules/file/tests/file_module_test.module	10 Sep 2009 04:24:43 -0000
@@ -22,7 +22,7 @@ function file_module_test_menu() {
   return $items;
 }
 
-function file_module_test_form($form_state) {
+function file_module_test_form($form, $form_state) {
   $form = array(
     '#tree' => TRUE,
   );
Index: modules/filter/filter.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v
retrieving revision 1.44
diff -u -p -r1.44 filter.admin.inc
--- modules/filter/filter.admin.inc	11 Sep 2009 15:39:48 -0000	1.44
+++ modules/filter/filter.admin.inc	11 Sep 2009 18:49:45 -0000
@@ -111,7 +111,7 @@ function filter_admin_format_page($forma
  * @see filter_admin_format_form_validate()
  * @see filter_admin_format_form_submit()
  */
-function filter_admin_format_form(&$form_state, $format) {
+function filter_admin_format_form($form, &$form_state, $format) {
   $default = ($format->format == variable_get('filter_default_format', 1));
   if ($default) {
     $help = t('All roles for the default format must be enabled and cannot be changed.');
@@ -219,7 +219,7 @@ function filter_admin_format_form_submit
  * @ingroup forms
  * @see filter_admin_delete_submit()
  */
-function filter_admin_delete(&$form_state, $format) {
+function filter_admin_delete($form, &$form_state, $format) {
   if ($format) {
     if ($format->format != variable_get('filter_default_format', 1)) {
       $form['#format'] = $format;
@@ -269,7 +269,7 @@ function filter_admin_configure_page($fo
  *
  * @ingroup forms
  */
-function filter_admin_configure(&$form_state, $format) {
+function filter_admin_configure($form, &$form_state, $format) {
   $filters = filter_list_format($format->format);
   $filter_info = filter_get_filters();
 
@@ -279,7 +279,7 @@ function filter_admin_configure(&$form_s
       // Pass along stored filter settings and default settings, but also the
       // format object and all filters to allow for complex implementations.
       $defaults = (isset($filter_info[$name]['default settings']) ? $filter_info[$name]['default settings'] : array());
-      $settings_form = $filter_info[$name]['settings callback']($form_state, $filters[$name], $defaults, $format, $filters);
+      $settings_form = $filter_info[$name]['settings callback']($form, $form_state, $filters[$name], $defaults, $format, $filters);
       if (isset($settings_form) && is_array($settings_form)) {
         $form['settings'][$name] = array(
           '#type' => 'fieldset',
@@ -339,7 +339,7 @@ function filter_admin_order_page($format
  * @see theme_filter_admin_order()
  * @see filter_admin_order_submit()
  */
-function filter_admin_order(&$form_state, $format = NULL) {
+function filter_admin_order($form, &$form_state, $format = NULL) {
   // Get list (with forced refresh).
   $filters = filter_list_format($format->format);
 
Index: modules/filter/filter.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.api.php,v
retrieving revision 1.13
diff -u -p -r1.13 filter.api.php
--- modules/filter/filter.api.php	27 Aug 2009 21:18:19 -0000	1.13
+++ modules/filter/filter.api.php	10 Sep 2009 04:24:43 -0000
@@ -91,7 +91,7 @@
  *   format.
  *
  * @code
- *   function mymodule_filter_settings(&$form_state, $filter, $defaults) {
+ *   function mymodule_filter_settings($form, &$form_state, $filter, $defaults) {
  *     $form['mymodule_url_length'] = array(
  *       '#type' => 'textfield',
  *       '#title' => t('Maximum link text length'),
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.289
diff -u -p -r1.289 filter.module
--- modules/filter/filter.module	12 Sep 2009 06:09:45 -0000	1.289
+++ modules/filter/filter.module	17 Sep 2009 02:48:44 -0000
@@ -841,7 +841,7 @@ function filter_filter_info() {
 /**
  * Settings callback for the HTML filter.
  */
-function _filter_html_settings(&$form_state, $filter, $defaults) {
+function _filter_html_settings($form, &$form_state, $filter, $defaults) {
   $form['allowed_html'] = array(
     '#type' => 'textfield',
     '#title' => t('Allowed HTML tags'),
@@ -887,7 +887,7 @@ function _filter_html($text, $filter) {
 /**
  * Settings callback for URL filter.
  */
-function _filter_url_settings(&$form_state, $filter, $defaults) {
+function _filter_url_settings($form, &$form_state, $filter, $defaults) {
   $form['filter_url_length'] = array(
     '#type' => 'textfield',
     '#title' => t('Maximum link text length'),
Index: modules/forum/forum.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.admin.inc,v
retrieving revision 1.24
diff -u -p -r1.24 forum.admin.inc
--- modules/forum/forum.admin.inc	30 Jul 2009 19:24:21 -0000	1.24
+++ modules/forum/forum.admin.inc	11 Sep 2009 18:51:44 -0000
@@ -27,7 +27,7 @@ function forum_form_main($type, $edit = 
  * @ingroup forms
  * @see forum_form_submit()
  */
-function forum_form_forum(&$form_state, $edit = array()) {
+function forum_form_forum($form, &$form_state, $edit = array()) {
   $edit += array(
     'name' => '',
     'description' => '',
@@ -105,7 +105,7 @@ function forum_form_submit($form, &$form
  * @ingroup forms
  * @see forum_form_submit()
  */
-function forum_form_container(&$form_state, $edit = array()) {
+function forum_form_container($form, &$form_state, $edit = array()) {
   $edit += array(
     'name' => '',
     'description' => '',
@@ -160,7 +160,7 @@ function forum_form_container(&$form_sta
  *
  * @param $tid ID of the term to be deleted
  */
-function forum_confirm_delete(&$form_state, $tid) {
+function forum_confirm_delete($form, &$form_state, $tid) {
   $term = taxonomy_term_load($tid);
 
   $form['tid'] = array('#type' => 'value', '#value' => $tid);
@@ -215,12 +215,12 @@ function forum_admin_settings() {
 /**
  * Returns an overview list of existing forums and containers
  */
-function forum_overview(&$form_state) {
+function forum_overview($form, &$form_state) {
   module_load_include('inc', 'taxonomy', 'taxonomy.admin');
 
   $vid = variable_get('forum_nav_vocabulary', '');
   $vocabulary = taxonomy_vocabulary_load($vid);
-  $form = taxonomy_overview_terms($form_state, $vocabulary);
+  $form = taxonomy_overview_terms($form, $form_state, $vocabulary);
 
   foreach (element_children($form) as $key) {
     if (isset($form[$key]['#term'])) {
Index: modules/image/image.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.admin.inc,v
retrieving revision 1.10
diff -u -p -r1.10 image.admin.inc
--- modules/image/image.admin.inc	5 Sep 2009 15:05:02 -0000	1.10
+++ modules/image/image.admin.inc	10 Sep 2009 04:24:43 -0000
@@ -35,7 +35,7 @@ function image_style_list() {
  * @see image_style_form_submit()
  * @see image_style_name_validate()
  */
-function image_style_form(&$form_state, $style) {
+function image_style_form($form, &$form_state, $style) {
   $title = t('Edit %name style', array('%name' => $style['name']));
   drupal_set_title($title, PASS_THROUGH);
 
@@ -187,7 +187,7 @@ function image_style_form_submit($form, 
  * @see image_style_add_form_submit()
  * @see image_style_name_validate()
  */
-function image_style_add_form(&$form_state) {
+function image_style_add_form($form, &$form_state) {
   $form = array();
 
   $form['name'] = array(
@@ -243,7 +243,7 @@ function image_style_name_validate($elem
  * @ingroup forms
  * @see image_style_delete_form_submit()
  */
-function image_style_delete_form($form_state, $style) {
+function image_style_delete_form($form, $form_state, $style) {
   $form_state['image_style'] = $style;
   $form = array();
 
@@ -298,7 +298,7 @@ function image_style_delete_form_submit(
  * @see image_crop_form()
  * @see image_effect_form_submit()
  */
-function image_effect_form(&$form_state, $style, $effect) {
+function image_effect_form($form, &$form_state, $style, $effect) {
   if (!empty($effect['data'])) {
     $title = t('Edit %label effect', array('%label' => $effect['label']));
   }
@@ -365,7 +365,7 @@ function image_effect_form_submit($form,
  * @ingroup forms
  * @see image_effect_delete_form_submit()
  */
-function image_effect_delete_form(&$form_state, $style, $effect) {
+function image_effect_delete_form($form, &$form_state, $style, $effect) {
   $form_state['image_style'] = $style;
   $form_state['image_effect'] = $effect;
 
Index: modules/menu/menu.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v
retrieving revision 1.57
diff -u -p -r1.57 menu.admin.inc
--- modules/menu/menu.admin.inc	5 Sep 2009 15:05:03 -0000	1.57
+++ modules/menu/menu.admin.inc	10 Sep 2009 04:24:43 -0000
@@ -40,7 +40,7 @@ function theme_menu_admin_overview($titl
  * Shows for one menu the menu links accessible to the current user and
  * relevant operations.
  */
-function menu_overview_form(&$form_state, $menu) {
+function menu_overview_form($form, &$form_state, $menu) {
   global $menu_admin;
   $sql = "
     SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.*
@@ -243,7 +243,7 @@ function theme_menu_overview_form($form)
 /**
  * Menu callback; Build the menu link editing form.
  */
-function menu_edit_item(&$form_state, $type, $item, $menu) {
+function menu_edit_item($form, &$form_state, $type, $item, $menu) {
 
   $form['menu'] = array(
     '#type' => 'fieldset',
@@ -404,7 +404,7 @@ function menu_edit_item_submit($form, &$
 /**
  * Menu callback; Build the form that handles the adding/editing of a custom menu.
  */
-function menu_edit_menu(&$form_state, $type, $menu = array()) {
+function menu_edit_menu($form, &$form_state, $type, $menu = array()) {
   $system_menus = menu_list_system_menus();
   $menu += array('menu_name' => '', 'title' => '', 'description' => '');
 
@@ -497,7 +497,7 @@ function menu_delete_menu_page($menu) {
 /**
  * Build a confirm form for deletion of a custom menu.
  */
-function menu_delete_menu_confirm(&$form_state, $menu) {
+function menu_delete_menu_confirm($form, &$form_state, $menu) {
   $form['#menu'] = $menu;
   $caption = '';
   $num_links = db_query("SELECT COUNT(*) FROM {menu_links} WHERE menu_name = :menu", array(':menu' => $menu['menu_name']))->fetchField();
@@ -639,7 +639,7 @@ function menu_item_delete_page($item) {
 /**
  * Build a confirm form for deletion of a single menu link.
  */
-function menu_item_delete_form(&$form_state, $item) {
+function menu_item_delete_form($form, &$form_state, $item) {
   $form['#item'] = $item;
   return confirm_form($form, t('Are you sure you want to delete the custom menu link %item?', array('%item' => $item['link_title'])), 'admin/structure/menu-customize/' . $item['menu_name']);
 }
@@ -659,7 +659,7 @@ function menu_item_delete_form_submit($f
 /**
  * Menu callback; reset a single modified menu link.
  */
-function menu_reset_item_confirm(&$form_state, $item) {
+function menu_reset_item_confirm($form, &$form_state, $item) {
   $form['item'] = array('#type' => 'value', '#value' => $item);
   return confirm_form($form, t('Are you sure you want to reset the link %item to its default values?', array('%item' => $item['link_title'])), 'admin/structure/menu-customize/' . $item['menu_name'], t('Any customizations will be lost. This action cannot be undone.'), t('Reset'));
 }
Index: modules/node/content_types.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v
retrieving revision 1.93
diff -u -p -r1.93 content_types.inc
--- modules/node/content_types.inc	10 Sep 2009 22:10:10 -0000	1.93
+++ modules/node/content_types.inc	17 Sep 2009 03:12:20 -0000
@@ -57,7 +57,7 @@ function theme_node_admin_overview($name
 /**
  * Generates the node type editing form.
  */
-function node_type_form(&$form_state, $type = NULL) {
+function node_type_form($form, &$form_state, $type = NULL) {
   if (!isset($type->type)) {
     // This is a new type. Node module managed types are custom and unlocked.
     $type = node_type_set_defaults(array('custom' => 1, 'locked' => 0));
@@ -415,7 +415,7 @@ function node_type_reset($type) {
 /**
  * Menu callback; delete a single content type.
  */
-function node_type_delete_confirm(&$form_state, $type) {
+function node_type_delete_confirm($form, &$form_state, $type) {
   $form['type'] = array('#type' => 'value', '#value' => $type->type);
   $form['name'] = array('#type' => 'value', '#value' => $type->name);
 
Index: modules/node/node.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v
retrieving revision 1.65
diff -u -p -r1.65 node.admin.inc
--- modules/node/node.admin.inc	5 Sep 2009 06:53:01 -0000	1.65
+++ modules/node/node.admin.inc	10 Sep 2009 04:24:43 -0000
@@ -366,7 +366,7 @@ function _node_mass_update_batch_finishe
 /**
  * Menu callback: content administration.
  */
-function node_admin_content($form_state) {
+function node_admin_content($form, $form_state) {
   if (isset($form_state['values']['operation']) && $form_state['values']['operation'] == 'delete') {
     return node_multiple_delete_confirm($form_state, array_filter($form_state['values']['nodes']));
   }
@@ -555,7 +555,7 @@ function theme_node_admin_nodes($form) {
   return $output;
 }
 
-function node_multiple_delete_confirm(&$form_state, $nodes) {
+function node_multiple_delete_confirm($form, &$form_state, $nodes) {
   $form['nodes'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
   // array_filter returns only elements with TRUE values
   foreach ($nodes as $nid => $value) {
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.79
diff -u -p -r1.79 node.pages.inc
--- modules/node/node.pages.inc	5 Sep 2009 15:05:03 -0000	1.79
+++ modules/node/node.pages.inc	17 Sep 2009 03:12:32 -0000
@@ -107,7 +107,7 @@ function node_object_prepare($node) {
 /**
  * Generate the node add/edit form array.
  */
-function node_form(&$form_state, $node) {
+function node_form($form, &$form_state, $node) {
   global $user;
 
   if (isset($form_state['node'])) {
@@ -453,7 +453,7 @@ function node_form_submit_build_node($fo
 /**
  * Menu callback -- ask for confirmation of node deletion
  */
-function node_delete_confirm(&$form_state, $node) {
+function node_delete_confirm($form, &$form_state, $node) {
   $form['nid'] = array(
     '#type' => 'value',
     '#value' => $node->nid,
@@ -536,7 +536,7 @@ function node_revision_overview($node) {
 /**
  * Ask for confirmation of the reversion to prevent against CSRF attacks.
  */
-function node_revision_revert_confirm($form_state, $node_revision) {
+function node_revision_revert_confirm($form, $form_state, $node_revision) {
   $form['#node_revision'] = $node_revision;
   return confirm_form($form, t('Are you sure you want to revert to the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', '', t('Revert'), t('Cancel'));
 }
@@ -556,7 +556,7 @@ function node_revision_revert_confirm_su
   $form_state['redirect'] = 'node/' . $node_revision->nid . '/revisions';
 }
 
-function node_revision_delete_confirm($form_state, $node_revision) {
+function node_revision_delete_confirm($form, $form_state, $node_revision) {
   $form['#node_revision'] = $node_revision;
   return confirm_form($form, t('Are you sure you want to delete the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
 }
Index: modules/openid/openid.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.inc,v
retrieving revision 1.19
diff -u -p -r1.19 openid.inc
--- modules/openid/openid.inc	15 Sep 2009 19:46:04 -0000	1.19
+++ modules/openid/openid.inc	17 Sep 2009 02:48:44 -0000
@@ -84,7 +84,7 @@ function openid_redirect($url, $message)
   exit;
 }
 
-function openid_redirect_form(&$form_state, $url, $message) {
+function openid_redirect_form($form, &$form_state, $url, $message) {
   $form = array();
   $form['#action'] = $url;
   $form['#method'] = "post";
Index: modules/openid/openid.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.pages.inc,v
retrieving revision 1.20
diff -u -p -r1.20 openid.pages.inc
--- modules/openid/openid.pages.inc	16 Sep 2009 22:47:18 -0000	1.20
+++ modules/openid/openid.pages.inc	17 Sep 2009 02:48:44 -0000
@@ -93,7 +93,7 @@ function openid_user_add_submit($form, &
 /**
  * Menu callback; Delete the specified OpenID identity from the system.
  */
-function openid_user_delete_form($form_state, $account, $aid = 0) {
+function openid_user_delete_form($form, $form_state, $account, $aid = 0) {
   $authname = db_query("SELECT authname FROM {authmap} WHERE uid = :uid AND aid = :aid AND module = 'openid'", array(
     ':uid' => $account->uid,
     ':aid' => $aid,
@@ -102,14 +102,14 @@ function openid_user_delete_form($form_s
   return confirm_form(array(), t('Are you sure you want to delete the OpenID %authname for %user?', array('%authname' => $authname, '%user' => $account->name)), 'user/' . $account->uid . '/openid');
 }
 
-function openid_user_delete_form_submit(&$form_state, $form_values) {
+function openid_user_delete_form_submit($form, &$form_state) {
   $query = db_delete('authmap')
-    ->condition('uid', $form_state['#args'][0]->uid)
-    ->condition('aid', $form_state['#args'][1])
+    ->condition('uid', $form_state['args'][0]->uid)
+    ->condition('aid', $form_state['args'][1])
     ->condition('module', 'openid')
     ->execute();
   if ($query) {
     drupal_set_message(t('OpenID deleted.'));
   }
-  $form_state['#redirect'] = 'user/' . $form_state['#args'][0]->uid . '/openid';
+  $form_state['#redirect'] = 'user/' . $form_state['args'][0]->uid . '/openid';
 }
Index: modules/path/path.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.admin.inc,v
retrieving revision 1.29
diff -u -p -r1.29 path.admin.inc
--- modules/path/path.admin.inc	28 Aug 2009 14:40:12 -0000	1.29
+++ modules/path/path.admin.inc	10 Sep 2009 04:24:43 -0000
@@ -98,7 +98,7 @@ function path_admin_edit($pid = 0) {
  * @see path_admin_form_validate()
  * @see path_admin_form_submit()
  */
-function path_admin_form(&$form_state, $edit = array('src' => '', 'dst' => '', 'language' => '', 'pid' => NULL)) {
+function path_admin_form($form, &$form_state, $edit = array('src' => '', 'dst' => '', 'language' => '', 'pid' => NULL)) {
 
   $form['#alias'] = $edit;
 
@@ -180,7 +180,7 @@ function path_admin_form_submit($form, &
 /**
  * Menu callback; confirms deleting an URL alias
  */
-function path_admin_delete_confirm($form_state, $pid) {
+function path_admin_delete_confirm($form, $form_state, $pid) {
   $path = path_load($pid);
   if (user_access('administer url aliases')) {
     $form['pid'] = array('#type' => 'value', '#value' => $pid);
@@ -209,7 +209,7 @@ function path_admin_delete_confirm_submi
  * @ingroup forms
  * @see path_admin_filter_form_submit()
  */
-function path_admin_filter_form(&$form_state, $keys = '') {
+function path_admin_filter_form($form, &$form_state, $keys = '') {
   $form['#attributes'] = array('class' => array('search-form'));
   $form['basic'] = array('#type' => 'fieldset',
     '#title' => t('Filter aliases')
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.312
diff -u -p -r1.312 poll.module
--- modules/poll/poll.module	10 Sep 2009 08:43:46 -0000	1.312
+++ modules/poll/poll.module	11 Sep 2009 16:55:49 -0000
@@ -628,7 +628,7 @@ function poll_teaser($node) {
  * @see poll_vote()
  * @see phptemplate_preprocess_poll_vote()
  */
-function poll_view_voting(&$form_state, $node, $block = FALSE) {
+function poll_view_voting($form, &$form_state, $node, $block = FALSE) {
   if ($node->choice) {
     $list = array();
     foreach ($node->choice as $i => $choice) {
@@ -837,7 +837,7 @@ function template_preprocess_poll_bar(&$
  * @ingroup forms
  * @see poll_cancel()
  */
-function poll_cancel_form(&$form_state, $nid) {
+function poll_cancel_form($form, &$form_state, $nid) {
   // Store the nid so we can get to it in submit functions.
   $form['#nid'] = $nid;
 
Index: modules/profile/profile.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.admin.inc,v
retrieving revision 1.29
diff -u -p -r1.29 profile.admin.inc
--- modules/profile/profile.admin.inc	22 Aug 2009 14:34:21 -0000	1.29
+++ modules/profile/profile.admin.inc	10 Sep 2009 04:24:43 -0000
@@ -170,7 +170,7 @@ function theme_profile_admin_overview($f
  * @see profile_field_form_validate()
  * @see profile_field_form_submit()
  */
-function profile_field_form(&$form_state, $arg = NULL) {
+function profile_field_form($form, &$form_state, $arg = NULL) {
   if (arg(4) == 'edit') {
     if (is_numeric($arg)) {
       $fid = $arg;
@@ -380,7 +380,7 @@ function profile_field_form_submit($form
 /**
  * Menu callback; deletes a field from all user profiles.
  */
-function profile_field_delete(&$form_state, $fid) {
+function profile_field_delete($form, &$form_state, $fid) {
   $field = db_query("SELECT title FROM {profile_field} WHERE fid = :fid", array(':fid' => $fid))->fetchObject();
   if (!$field) {
     drupal_not_found();
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.314
diff -u -p -r1.314 search.module
--- modules/search/search.module	5 Sep 2009 10:53:09 -0000	1.314
+++ modules/search/search.module	10 Sep 2009 04:22:19 -0000
@@ -864,7 +864,7 @@ function search_get_keys() {
  * @return
  *   An HTML string containing the search form.
  */
-function search_form(&$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) {
+function search_form($form, &$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) {
 
   // Add CSS
   drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => FALSE));
@@ -906,7 +906,7 @@ function search_form(&$form_state, $acti
  * @see search-theme-form.tpl.php
  * @see search-block-form.tpl.php
  */
-function search_box(&$form_state, $form_id) {
+function search_box($form, &$form_state, $form_id) {
   $form[$form_id] = array(
     '#title' => t('Search this site'),
     '#type' => 'textfield',
Index: modules/simpletest/simpletest.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.pages.inc,v
retrieving revision 1.16
diff -u -p -r1.16 simpletest.pages.inc
--- modules/simpletest/simpletest.pages.inc	11 Sep 2009 01:53:29 -0000	1.16
+++ modules/simpletest/simpletest.pages.inc	11 Sep 2009 16:55:49 -0000
@@ -196,7 +196,7 @@ function simpletest_test_form_submit($fo
 /**
  * Test results form for $test_id.
  */
-function simpletest_result_form(&$form_state, $test_id) {
+function simpletest_result_form($form, &$form_state, $test_id) {
   $form = array();
 
   // Make sure there are test results to display and a re-run is not being performed.
@@ -417,7 +417,7 @@ function simpletest_result_status_image(
 /**
  * Provides settings form for SimpleTest variables.
  */
-function simpletest_settings_form(&$form_state) {
+function simpletest_settings_form($form, &$form_state) {
   $form = array();
 
   $form['general'] = array(
Index: modules/simpletest/tests/browser_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/browser_test.module,v
retrieving revision 1.1
diff -u -p -r1.1 browser_test.module
--- modules/simpletest/tests/browser_test.module	17 Aug 2009 06:08:47 -0000	1.1
+++ modules/simpletest/tests/browser_test.module	10 Sep 2009 04:24:43 -0000
@@ -39,7 +39,7 @@ function browser_test_print_get() {
   exit;
 }
 
-function browser_test_print_post_form(&$form_state) {
+function browser_test_print_post_form($form, &$form_state) {
   $form = array();
 
   $form['foo'] = array(
Index: modules/simpletest/tests/field_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.module,v
retrieving revision 1.22
diff -u -p -r1.22 field_test.module
--- modules/simpletest/tests/field_test.module	10 Sep 2009 06:31:39 -0000	1.22
+++ modules/simpletest/tests/field_test.module	11 Sep 2009 16:55:49 -0000
@@ -256,7 +256,7 @@ function field_test_entity_edit($entity)
 /**
  * Form to set the value of fields attached to our entity.
  */
-function field_test_entity_form(&$form_state, $entity) {
+function field_test_entity_form($form, &$form_state, $entity) {
   $form = array();
 
   if (isset($form_state['test_entity'])) {
Index: modules/simpletest/tests/file_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file_test.module,v
retrieving revision 1.16
diff -u -p -r1.16 file_test.module
--- modules/simpletest/tests/file_test.module	11 Sep 2009 04:45:23 -0000	1.16
+++ modules/simpletest/tests/file_test.module	11 Sep 2009 16:55:49 -0000
@@ -44,7 +44,7 @@ function file_test_stream_wrappers() {
 /**
  * Form to test file uploads.
  */
-function _file_test_form(&$form_state) {
+function _file_test_form($form, &$form_state) {
   $form['file_test_upload'] = array(
     '#type' => 'file',
     '#title' => t('Upload an image'),
Index: modules/simpletest/tests/form.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v
retrieving revision 1.14
diff -u -p -r1.14 form.test
--- modules/simpletest/tests/form.test	13 Jul 2009 21:51:41 -0000	1.14
+++ modules/simpletest/tests/form.test	11 Sep 2009 23:33:19 -0000
@@ -449,3 +449,30 @@ class FormsFormStorageTestCase extends D
     $this->assertPattern('/value_is_set/', t("The input values have been kept."));
   }
 }
+
+/**
+ * Test wrapper form callbacks.
+ */
+class FormsFormWrapperTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Form wrapper callback',
+      'description' => 'Tests form wrapper callbacks to pass a prebuilt form to form builder functions.',
+      'group' => 'Form API',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('form_test');
+  }
+
+  /**
+   * Tests using the form in a usual way.
+   */
+  function testWrapperCallback() {
+    $this->drupalGet('form_test/wrapper-callback');
+    $this->assertText('Form wrapper callback element output.', t('The form contains form wrapper elements.'));
+    $this->assertText('Form builder element output.', t('The form contains form builder elements.'));
+  }
+}
+
Index: modules/simpletest/tests/form_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form_test.module,v
retrieving revision 1.8
diff -u -p -r1.8 form_test.module
--- modules/simpletest/tests/form_test.module	17 Aug 2009 07:12:16 -0000	1.8
+++ modules/simpletest/tests/form_test.module	12 Sep 2009 00:09:07 -0000
@@ -10,8 +10,6 @@
  * Implement hook_menu().
  */
 function form_test_menu() {
-  $items = array();
-
   $items['form_test/tableselect/multiple-true'] = array(
     'title' => 'Tableselect checkboxes test',
     'page callback' => 'drupal_get_form',
@@ -19,7 +17,6 @@ function form_test_menu() {
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
-
   $items['form_test/tableselect/multiple-false'] = array(
     'title' => 'Tableselect radio button test',
     'page callback' => 'drupal_get_form',
@@ -27,7 +24,6 @@ function form_test_menu() {
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
-
   $items['form_test/tableselect/empty-text'] = array(
     'title' => 'Tableselect empty text test',
     'page callback' => 'drupal_get_form',
@@ -35,7 +31,6 @@ function form_test_menu() {
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
-
   $items['form_test/tableselect/advanced-select'] = array(
     'title' => 'Tableselect js_select tests',
     'page callback' => 'drupal_get_form',
@@ -66,6 +61,14 @@ function form_test_menu() {
     'type' => MENU_CALLBACK,
   );
 
+  $items['form_test/wrapper-callback'] = array(
+    'title' => 'Form wrapper callback test',
+    'page callback' => 'form_test_wrapper_callback',
+    'page arguments' => array('form_test_wrapper_callback_form'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+
   return $items;
 }
 
@@ -82,7 +85,7 @@ function form_test_form_clean_id_page() 
 /**
  * A simple form to test clean_id generation.
  */
-function form_test_test_form(&$form_state) {
+function form_test_test_form($form, &$form_state) {
   $form['input'] = array(
     '#type' => 'item',
     '#title' => 'Test Textfield',
@@ -137,7 +140,7 @@ function _form_test_tableselect_get_data
  * @return
  *   A form with a tableselect element and a submit button.
  */
-function _form_test_tableselect_form_builder($form_state, $element_properties) {
+function _form_test_tableselect_form_builder($form, $form_state, $element_properties) {
   $form = array();
 
   list($header, $options) = _form_test_tableselect_get_data();
@@ -163,8 +166,8 @@ function _form_test_tableselect_form_bui
 /**
  * Test the tableselect #multiple = TRUE functionality.
  */
-function _form_test_tableselect_multiple_true_form($form_state) {
-  return _form_test_tableselect_form_builder($form_state, array('#multiple' => TRUE));
+function _form_test_tableselect_multiple_true_form($form, $form_state) {
+  return _form_test_tableselect_form_builder($form, $form_state, array('#multiple' => TRUE));
 }
 
 /**
@@ -180,8 +183,8 @@ function _form_test_tableselect_multiple
 /**
  * Test the tableselect #multiple = FALSE functionality.
  */
-function _form_test_tableselect_multiple_false_form($form_state) {
-  return _form_test_tableselect_form_builder($form_state, array('#multiple' => FALSE));
+function _form_test_tableselect_multiple_false_form($form, $form_state) {
+  return _form_test_tableselect_form_builder($form, $form_state, array('#multiple' => FALSE));
 }
 
 /**
@@ -194,17 +197,15 @@ function _form_test_tableselect_multiple
 /**
  * Test functionality of the tableselect #empty property.
  */
-function _form_test_tableselect_empty_form($form_state) {
-  return _form_test_tableselect_form_builder($form_state, array('#options' => array()));
+function _form_test_tableselect_empty_form($form, $form_state) {
+  return _form_test_tableselect_form_builder($form, $form_state, array('#options' => array()));
 }
 
 /**
  * Test functionality of the tableselect #js_select property.
  */
-function _form_test_tableselect_js_select_form($form_state, $action) {
-
+function _form_test_tableselect_js_select_form($form, $form_state, $action) {
   switch ($action) {
-
     case 'multiple-true-default':
       $options = array('#multiple' => TRUE);
       break;
@@ -222,7 +223,7 @@ function _form_test_tableselect_js_selec
       break;
   }
 
-  return _form_test_tableselect_form_builder($form_state, $options);
+  return _form_test_tableselect_form_builder($form, $form_state, $options);
 }
 
 /**
@@ -263,7 +264,7 @@ function form_test_batch_callback($value
 /**
  * A simple form with a textfield and submit button.
  */
-function form_test_mock_form($form_state) {
+function form_test_mock_form($form, $form_state) {
   $form = array();
 
   $form['test_value'] = array(
@@ -298,7 +299,7 @@ function form_test_mock_form_submit($for
  *
  * @see form_storage_test_form_submit().
  */
-function form_storage_test_form(&$form_state) {
+function form_storage_test_form($form, &$form_state) {
   // Initialize
   if (!isset($form_state['storage'])) {
     if (empty($form_state['input'])) {
@@ -365,3 +366,31 @@ function form_storage_test_form_submit($
   $form_state['storage']['step']++;
   drupal_set_message("Form constructions: ". $_SESSION['constructions']);
 }
+
+/**
+ * Menu callback; Invokes a form builder function with a wrapper callback.
+ */
+function form_test_wrapper_callback($form_id) {
+  $form_state = array(
+    'args' => array(),
+    'wrapper_callback' => 'form_test_wrapper_callback_wrapper',
+  );
+  return drupal_build_form($form_id, $form_state);
+}
+
+/**
+ * Form wrapper for form_test_wrapper_callback_form().
+ */
+function form_test_wrapper_callback_wrapper($form, &$form_state) {
+  $form['wrapper'] = array('#markup' => 'Form wrapper callback element output.');
+  return $form;
+}
+
+/**
+ * Form builder for form wrapper callback test.
+ */
+function form_test_wrapper_callback_form($form, &$form_state) {
+  $form['builder'] = array('#markup' => 'Form builder element output.');
+  return $form;
+}
+
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.201
diff -u -p -r1.201 system.admin.inc
--- modules/system/system.admin.inc	11 Sep 2009 04:09:26 -0000	1.201
+++ modules/system/system.admin.inc	11 Sep 2009 16:55:50 -0000
@@ -378,7 +378,7 @@ function system_themes_form_submit($form
  * @ingroup forms
  * @see system_theme_settings_submit()
  */
-function system_theme_settings(&$form_state, $key = '') {
+function system_theme_settings($form, &$form_state, $key = '') {
   $directory_path = file_directory_path();
   if (!file_prepare_directory($directory_path, FILE_CREATE_DIRECTORY)) {
     drupal_set_message(t('The directory %directory does not exist or is not writable.', array('%directory' => $directory_path)), 'warning');
@@ -633,7 +633,7 @@ function _system_is_incompatible(&$incom
  * @return
  *   The form array.
  */
-function system_modules($form_state = array()) {
+function system_modules($form, $form_state = array()) {
   // Get current list of modules.
   $files = system_get_module_data();
 
@@ -1034,7 +1034,7 @@ function system_modules_submit($form, &$
  * @return
  *   A form array representing the currently disabled modules.
  */
-function system_modules_uninstall($form_state = NULL) {
+function system_modules_uninstall($form, $form_state = NULL) {
   // Make sure the install API is available.
   include_once DRUPAL_ROOT . '/includes/install.inc';
 
@@ -1186,7 +1186,7 @@ function system_ip_blocking() {
  * @see system_ip_blocking_form_validate()
  * @see system_ip_blocking_form_submit()
  */
-function system_ip_blocking_form($form_state) {
+function system_ip_blocking_form($form, $form_state) {
   $form['ip'] = array(
     '#title' => t('IP address'),
     '#type' => 'textfield',
@@ -1232,7 +1232,7 @@ function system_ip_blocking_form_submit(
  *
  * @see system_ip_blocking_delete_submit()
  */
-function system_ip_blocking_delete(&$form_state, $iid) {
+function system_ip_blocking_delete($form, &$form_state, $iid) {
   $form['blocked_ip'] = array(
     '#type' => 'value',
     '#value' => $iid,
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.790
diff -u -p -r1.790 system.module
--- modules/system/system.module	15 Sep 2009 17:10:39 -0000	1.790
+++ modules/system/system.module	17 Sep 2009 02:48:45 -0000
@@ -2536,7 +2536,7 @@ function system_actions_manage() {
  * @return
  *   Form definition.
  */
-function system_actions_manage_form($form_state, $options = array()) {
+function system_actions_manage_form($form, $form_state, $options = array()) {
   $form['parent'] = array(
     '#type' => 'fieldset',
     '#title' => t('Make a new advanced action available'),
@@ -2582,7 +2582,7 @@ function system_actions_manage_form_subm
  * @return
  *   Form definition.
  */
-function system_actions_configure($form_state, $action = NULL) {
+function system_actions_configure($form, &$form_state, $action = NULL) {
   if ($action === NULL) {
     drupal_goto('admin/config/system/actions');
   }
@@ -2685,7 +2685,7 @@ function system_actions_configure_submit
  * @ingroup forms
  * @see system_actions_delete_form_submit()
  */
-function system_actions_delete_form($form_state, $action) {
+function system_actions_delete_form($form, $form_state, $action) {
 
   $form['aid'] = array(
     '#type' => 'hidden',
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.68
diff -u -p -r1.68 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	5 Sep 2009 15:05:04 -0000	1.68
+++ modules/taxonomy/taxonomy.admin.inc	11 Sep 2009 20:57:58 -0000
@@ -102,7 +102,7 @@ function theme_taxonomy_overview_vocabul
  * @ingroup forms
  * @see taxonomy_form_vocabulary_submit()
  */
-function taxonomy_form_vocabulary(&$form_state, $edit = array()) {
+function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) {
   if (!is_array($edit)) {
     $edit = (array)$edit;
   }
@@ -121,7 +121,7 @@ function taxonomy_form_vocabulary(&$form
   $form['#vocabulary'] = (object) $edit;
   // Check whether we need a deletion confirmation form.
   if (isset($form_state['confirm_delete']) && isset($form_state['values']['vid'])) {
-    return taxonomy_vocabulary_confirm_delete($form_state, $form_state['values']['vid']);
+    return taxonomy_vocabulary_confirm_delete($form, $form_state, $form_state['values']['vid']);
   }
   $form['name'] = array(
     '#type' => 'textfield',
@@ -278,7 +278,7 @@ function taxonomy_form_vocabulary_submit
  * @see taxonomy_overview_terms_submit()
  * @see theme_taxonomy_overview_terms()
  */
-function taxonomy_overview_terms(&$form_state, $vocabulary) {
+function taxonomy_overview_terms($form, &$form_state, $vocabulary) {
   global $pager_page_array, $pager_total, $pager_total_items;
 
   // Check for confirmation forms.
@@ -677,7 +677,7 @@ function theme_taxonomy_overview_terms($
  * @ingroup forms
  * @see taxonomy_form_term_submit()
  */
-function taxonomy_form_term(&$form_state, $vocabulary, $edit = array()) {
+function taxonomy_form_term($form, &$form_state, $vocabulary, $edit = array()) {
   $edit += array(
     'name' => '',
     'description' => '',
@@ -700,10 +700,10 @@ function taxonomy_form_term(&$form_state
 
   // Check for confirmation forms.
   if (isset($form_state['confirm_delete'])) {
-    return array_merge($form, taxonomy_term_confirm_delete($form_state, $edit['tid']));
+    return array_merge($form, taxonomy_term_confirm_delete($form, $form_state, $edit['tid']));
   }
   elseif (isset($form_state['confirm_parents'])) {
-    return array_merge($form, taxonomy_term_confirm_parents($form_state, $vocabulary));
+    return array_merge($form, taxonomy_term_confirm_parents($form, $form_state, $vocabulary));
   }
 
   $form['identification'] = array(
@@ -885,7 +885,7 @@ function taxonomy_form_term_submit_build
  * @ingroup forms
  * @see taxonomy_form_term()
  */
-function taxonomy_term_confirm_parents(&$form_state, $vocabulary) {
+function taxonomy_term_confirm_parents($form, &$form_state, $vocabulary) {
   $form = array();
   foreach (element_children($form_state['values']) as $key) {
     $form[$key] = array(
@@ -905,7 +905,7 @@ function taxonomy_term_confirm_parents(&
  * @ingroup forms
  * @see taxonomy_term_confirm_delete_submit()
  */
-function taxonomy_term_confirm_delete(&$form_state, $tid) {
+function taxonomy_term_confirm_delete($form, &$form_state, $tid) {
   $term = taxonomy_term_load($tid);
 
   $form['type'] = array('#type' => 'value', '#value' => 'term');
@@ -942,7 +942,7 @@ function taxonomy_term_confirm_delete_su
  * @ingroup forms
  * @see taxonomy_vocabulary_confirm_delete_submit()
  */
-function taxonomy_vocabulary_confirm_delete(&$form_state, $vid) {
+function taxonomy_vocabulary_confirm_delete($form, &$form_state, $vid) {
   $vocabulary = taxonomy_vocabulary_load($vid);
 
   $form['#id'] = 'taxonomy_vocabulary_confirm_delete';
@@ -978,7 +978,7 @@ function taxonomy_vocabulary_confirm_del
  * @ingroup forms
  * @see taxonomy_vocabulary_confirm_reset_alphabetical_submit()
  */
-function taxonomy_vocabulary_confirm_reset_alphabetical(&$form_state, $vid) {
+function taxonomy_vocabulary_confirm_reset_alphabetical($form, &$form_state, $vid) {
   $vocabulary = taxonomy_vocabulary_load($vid);
 
   $form['type'] = array('#type' => 'value', '#value' => 'vocabulary');
Index: modules/trigger/trigger.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v
retrieving revision 1.16
diff -u -p -r1.16 trigger.admin.inc
--- modules/trigger/trigger.admin.inc	1 Sep 2009 16:50:12 -0000	1.16
+++ modules/trigger/trigger.admin.inc	10 Sep 2009 04:24:44 -0000
@@ -46,7 +46,7 @@ function trigger_assign($type = NULL) {
  * @ingroup forms
  * @see trigger_unassign_submit()
  */
-function trigger_unassign($form_state, $hook = NULL, $op = NULL, $aid = NULL) {
+function trigger_unassign($form, $form_state, $hook = NULL, $op = NULL, $aid = NULL) {
   if (!($hook && $op && $aid)) {
     drupal_goto('admin/structure/trigger/assign');
   }
@@ -114,7 +114,7 @@ function trigger_unassign_submit($form, 
  * @see trigger_assign_form_validate()
  * @see trigger_assign_form_submit()
  */
-function trigger_assign_form($form_state, $hook, $op, $description) {
+function trigger_assign_form($form, $form_state, $hook, $op, $description) {
   $form['hook'] = array(
     '#type' => 'hidden',
     '#value' => $hook,
Index: modules/user/user.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v
retrieving revision 1.77
diff -u -p -r1.77 user.admin.inc
--- modules/user/user.admin.inc	5 Sep 2009 15:05:05 -0000	1.77
+++ modules/user/user.admin.inc	10 Sep 2009 04:28:31 -0000
@@ -206,7 +206,7 @@ function user_admin_account() {
  * Submit the user administration update form.
  */
 function user_admin_account_submit($form, &$form_state) {
-  $operations = module_invoke_all('user_operations', $form_state);
+  $operations = module_invoke_all('user_operations', $form, $form_state);
   $operation = $operations[$form_state['values']['operation']];
   // Filter out unchecked accounts.
   $accounts = array_filter($form_state['values']['accounts']);
@@ -602,7 +602,7 @@ function user_admin_settings() {
  * @see user_admin_permissions_submit()
  * @see theme_user_admin_permissions()
  */
-function user_admin_permissions($form_state, $rid = NULL) {
+function user_admin_permissions($form, $form_state, $rid = NULL) {
 
   // Retrieve role names for columns.
   $role_names = user_roles();
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1043
diff -u -p -r1.1043 user.module
--- modules/user/user.module	11 Sep 2009 06:20:49 -0000	1.1043
+++ modules/user/user.module	11 Sep 2009 17:31:49 -0000
@@ -864,8 +864,9 @@ function user_user_view($account) {
  */
 function user_user_form(&$edit, $account, $category) {
   if ($category == 'account') {
+    $form = array();
     $form_state = array();
-    return user_edit_form($form_state, (isset($account->uid) ? $account->uid : FALSE), $edit);
+    return user_edit_form($form, $form_state, (isset($account->uid) ? $account->uid : FALSE), $edit);
   }
 }
 
@@ -1544,7 +1545,7 @@ function user_set_authmaps($account, $au
  *
  * @ingroup forms
  */
-function user_login(&$form_state) {
+function user_login($form, &$form_state) {
   global $user;
 
   // If we are already logged on, go to the user page instead.
@@ -1811,7 +1812,7 @@ function user_pass_rehash($password, $ti
   return md5($timestamp . $password . $login);
 }
 
-function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) {
+function user_edit_form($form, &$form_state, $uid, $edit, $register = FALSE) {
   _user_password_dynamic_validation();
   $admin = user_access('administer users');
 
@@ -2351,7 +2352,7 @@ function user_role_set_permissions($role
 /**
  * Implement hook_user_operations().
  */
-function user_user_operations($form_state = array()) {
+function user_user_operations($form = array(), $form_state = array()) {
   $operations = array(
     'unblock' => array(
       'label' => t('Unblock the selected users'),
@@ -2475,7 +2476,7 @@ function user_multiple_role_edit($accoun
   }
 }
 
-function user_multiple_cancel_confirm(&$form_state) {
+function user_multiple_cancel_confirm($form, &$form_state) {
   $edit = $form_state['input'];
 
   $form['accounts'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
@@ -3041,7 +3042,7 @@ function user_register_submit($form, &$f
  * @see user_register_validate()
  * @see user_register_submit()
  */
-function user_register() {
+function user_register($form, &$form_state) {
   global $user;
 
   $admin = user_access('administer users');
@@ -3052,7 +3053,7 @@ function user_register() {
   }
 
   // Start with the default user edit fields.
-  $form = user_edit_form($form_state, NULL, NULL, TRUE);
+  $form = user_edit_form($form, $form_state, NULL, NULL, TRUE);
   if ($admin) {
     $form['account']['notify'] = array(
      '#type' => 'checkbox',
Index: modules/user/user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.51
diff -u -p -r1.51 user.pages.inc
--- modules/user/user.pages.inc	10 Sep 2009 12:33:46 -0000	1.51
+++ modules/user/user.pages.inc	11 Sep 2009 16:55:52 -0000
@@ -75,7 +75,7 @@ function user_pass_submit($form, &$form_
 /**
  * Menu callback; process one time login link and redirects to the user page on success.
  */
-function user_pass_reset(&$form_state, $uid, $timestamp, $hashed_pass, $action = NULL) {
+function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $action = NULL) {
   global $user;
 
   // When processing the one-time login link, we have to make sure that a user
@@ -225,7 +225,7 @@ function user_edit($account, $category =
  * @see user_profile_form_submit()
  * @see user_cancel_confirm_form_submit()
  */
-function user_profile_form($form_state, $account, $category = 'account') {
+function user_profile_form($form, $form_state, $account, $category = 'account') {
   global $user;
 
   $edit = (empty($form_state['values'])) ? (array)$account : $form_state['values'];
@@ -306,7 +306,7 @@ function user_edit_cancel_submit($form, 
  * @ingroup forms
  * @see user_edit_cancel_submit()
  */
-function user_cancel_confirm_form(&$form_state, $account) {
+function user_cancel_confirm_form($form, &$form_state, $account) {
   global $user;
 
   $form['_account'] = array('#type' => 'value', '#value' => $account);
