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	11 Nov 2009 06:01:40 -0000
@@ -101,7 +101,7 @@ function drupal_get_form($form_id) {
  *     rebuild the form from cache when the original context may no longer be
  *     available:
  *     - args: An array of arguments to pass to the form builder.
- *     - file: An optional include file that contains the form and is
+ *     - files: An optional array of files to include to build the form that are
  *       automatically loaded by form_get_cache(). Defaults to the current menu
  *       router item's 'file' definition, if existent.
  *   - input: An array of input that corresponds to $_POST or $_GET, depending
@@ -174,10 +174,10 @@ function drupal_build_form($form_id, &$f
       // rebuilt from cache on a different path (such as 'system/ajax').
       // @see form_get_cache()
       // menu_get_item() is not available at installation time.
-      if (!isset($form_state['build_info']['file']) && !defined('MAINTENANCE_MODE')) {
+      if (!isset($form_state['build_info']['files']) && !defined('MAINTENANCE_MODE')) {
         $item = menu_get_item();
         if (!empty($item['file'])) {
-          $form_state['build_info']['file'] = $item['file'];
+          $form_state['build_info']['files'][] = $item['file'];
         }
       }
 
@@ -337,8 +337,12 @@ function form_get_cache($form_build_id, 
 
         // If the original form is contained in an include file, load the file.
         // @see drupal_build_form()
-        if (!empty($form_state['build_info']['file']) && file_exists($form_state['build_info']['file'])) {
-          require_once DRUPAL_ROOT . '/' . $form_state['build_info']['file'];
+        if (!empty($form_state['build_info']['files'])) {
+          foreach ($form_state['build_info']['files'] as $include) {
+            if (file_exists(DRUPAL_ROOT . '/' . $include)) {
+              include_once DRUPAL_ROOT . '/' . $include;
+            }
+          }
         }
       }
       return $form;
