Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.165
diff -u -F^f -r1.165 upload.module
--- modules/upload/upload.module	15 Jun 2007 22:00:30 -0000	1.165
+++ modules/upload/upload.module	17 Jun 2007 01:36:23 -0000
@@ -654,7 +654,7 @@ function _upload_form($node) {
       '#value' => t('Attach'),
       '#name' => 'attach',
       '#id' => 'attach-button',
-      '#submit' => array(),
+      '#submit' => array('upload_attach_submit'),
     );
     // The class triggers the js upload behaviour.
     $form['attach-url'] = array('#type' => 'hidden', '#value' => url('upload/js', array('absolute' => TRUE)), '#attributes' => array('class' => 'upload'));
@@ -665,6 +665,15 @@ function _upload_form($node) {
   return $form;
 }
 
+function upload_attach_submit($form, &$form_state) {
+  // We do not want to execute button level handlers, we want the form level
+  // handlers to go in and change the submitted values.
+  unset($form_state['submit_handlers']);
+  form_execute_handlers('submit', $form, $form_state);
+  $form_state['rebuild'] = TRUE;
+  $form_state['node'] = $form_state['values'];
+}
+
 /**
  * Theme the attachments list.
  */
