? 776956-managed-file-attributes-3.patch
? includes/.form.inc.swp
? modules/file/.file.js.swp
? sites/d7.ptmb
? sites/all/modules/test_module
? sites/default/settings.php
Index: modules/file/file.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/file.js,v
retrieving revision 1.1
diff -u -p -r1.1 file.js
--- modules/file/file.js	29 Aug 2009 12:52:32 -0000	1.1
+++ modules/file/file.js	21 Apr 2010 00:29:38 -0000
@@ -81,6 +81,7 @@ Drupal.file = Drupal.file || {
   disableFields: function(event){
     var clickedButton = this;
 
+    console.log(this);
     // Only disable upload fields for AJAX buttons.
     if (!$(clickedButton).hasClass('ajax-processed')) {
       return;
@@ -92,7 +93,11 @@ Drupal.file = Drupal.file || {
       $enabledFields = $(this).parents('div.form-managed-file').find('input.form-file');
     }
 
-    var $disabledFields = $('div.form-managed-file input.form-file').not($enabledFields);
+    var $disabledFields = $('div.form-managed-file input.form-file').not($enabledFields).each(function() {
+      if ($(this).is(':disabled')) {
+        $(this).addClass('disabled');
+      }
+    });
 
     // Disable upload fields other than the one we're currently working with.
     $disabledFields.attr('disabled', 'disabled');
@@ -102,7 +107,8 @@ Drupal.file = Drupal.file || {
     // re-enables the file fields after other processing is complete even though
     // it is only a 1 second timeout.
     setTimeout(function(){
-      $disabledFields.attr('disabled', '');
+      $disabledFields.filter(':not(.disabled)').attr('disabled', '')
+      .end().filter('.disabled').removeClass('disabled');
     }, 1000);
   },
   /**
Index: modules/file/file.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/file.module,v
retrieving revision 1.25
diff -u -p -r1.25 file.module
--- modules/file/file.module	13 Apr 2010 15:23:03 -0000	1.25
+++ modules/file/file.module	21 Apr 2010 00:29:38 -0000
@@ -369,6 +369,7 @@ function file_managed_file_process($elem
     '#limit_validation_errors' => array($element['#parents']),
     '#ajax' => $ajax_settings,
     '#weight' => -5,
+    '#attributes' => $element['#attributes'],
   );
 
   $ajax_settings['progress']['type'] ? $ajax_settings['progress']['type'] == 'bar' : 'throbber';
@@ -383,6 +384,7 @@ function file_managed_file_process($elem
     '#limit_validation_errors' => array($element['#parents']),
     '#ajax' => $ajax_settings,
     '#weight' => -5,
+    '#attributes' => $element['#attributes'],
   );
 
   // @todo It is not good to call these private functions. This should be
@@ -440,6 +442,7 @@ function file_managed_file_process($elem
     '#access' => empty($fid),
     '#theme_wrappers' => array(),
     '#weight' => -10,
+    '#attributes' => $element['#attributes'],
   );
 
   if ($fid && $element['#file']) {
