diff --git includes/form.inc includes/form.inc
index 2c6e61f..8469f60 100644
--- includes/form.inc
+++ includes/form.inc
@@ -104,7 +104,10 @@ 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 defining include files that need to be loaded
+ *       for building the form. Each array entry may be the path to a file or
+ *       another array containing values for the parameters 'type', 'module' and
+ *       'name' as needed by module_load_include(). The files listed here are
  *       automatically loaded by form_get_cache(). Defaults to the current menu
  *       router item's 'file' definition, if existent.
  *   - rebuild: Normally, after the entire form processing is completed and
@@ -195,10 +198,10 @@ function drupal_build_form($form_id, &$form_state) {
       // 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'];
         }
       }
 
@@ -371,10 +374,17 @@ function form_get_cache($form_build_id, &$form_state) {
         // Re-populate $form_state for subsequent rebuilds.
         $form_state = $cached->data + $form_state;
 
-        // If the original form is contained in an include file, load the file.
+        // If the original form is contained in include files, load the files.
         // 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'];
+        $form_state['build_info'] += array('files' => array());
+        foreach ($form_state['build_info']['files'] as $file) {
+          if (is_array($file)) {
+            $file += array('type' => 'inc', 'name' => $file['module']);
+            module_load_include($file['type'], $file['module'], $file['name']);
+          }
+          elseif (file_exists($file)) {
+            require_once DRUPAL_ROOT . '/' . $file;
+          }
         }
       }
       return $form;
