diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-09-13 01:09:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-09-13 01:09:26 +0000 |
commit | f8b63338e48a6b0ef52e024030b0330c0fc8af53 (patch) | |
tree | d411369da8a9110f6a3d715f325130e289d03713 /modules/file | |
parent | 1b3c481ad151fff0fe22b1b00330c08e0244203b (diff) | |
download | brdo-f8b63338e48a6b0ef52e024030b0330c0fc8af53.tar.gz brdo-f8b63338e48a6b0ef52e024030b0330c0fc8af53.tar.bz2 |
- Patch #756762 by effulgentsia, fago, sun, rfay, pwolanin: AJAX should follow same rules for whether to call drupal_rebuild_form() as non-AJAX submissions.
Diffstat (limited to 'modules/file')
-rw-r--r-- | modules/file/file.module | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/modules/file/file.module b/modules/file/file.module index 1388f179b..5d76b6c82 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -254,7 +254,7 @@ function file_ajax_upload() { return array('#type' => 'ajax', '#commands' => $commands, '#header' => FALSE); } - list($form, $form_state, $form_id, $form_build_id) = ajax_get_form(); + list($form, $form_state) = ajax_get_form(); if (!$form) { // Invalid form_build_id. @@ -271,12 +271,8 @@ function file_ajax_upload() { } $current_file_count = isset($current_element['#file_upload_delta']) ? $current_element['#file_upload_delta'] : 0; - // Build, validate and if possible, submit the form. - drupal_process_form($form_id, $form, $form_state); - - // This call recreates the form relying solely on the form_state that the - // drupal_process_form() set up. - $form = drupal_rebuild_form($form_id, $form_state, $form); + // Process user input. $form and $form_state are modified in the process. + drupal_process_form($form['#form_id'], $form, $form_state); // Retrieve the element to be rendered. foreach ($form_parents as $parent) { |