Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.199
diff -u -p -r1.199 upload.module
--- modules/upload/upload.module	20 Feb 2008 13:46:42 -0000	1.199
+++ modules/upload/upload.module	7 Apr 2008 21:28:13 -0000
@@ -614,6 +614,8 @@ function upload_js() {
     }
   }
 
+  drupal_alter('form', $form, array(), 'upload_js');
+
   // Add the new element to the stored form state and resave.
   $cache->data['attachments']['wrapper'] = array_merge($cache->data['attachments']['wrapper'], $form);
   cache_set('form_'. $_POST['form_build_id'], $cache->data, 'cache_form', $cache->expire);
@@ -625,7 +627,6 @@ function upload_js() {
     '#tree' => FALSE,
     '#parents' => array(),
   );
-  drupal_alter('form', $form, array(), 'upload_js');
   $form_state = array('submitted' => FALSE);
   $form = form_builder('upload_js', $form, $form_state);
   $output = theme('status_messages') . drupal_render($form);
