Index: components/file.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/file.inc,v
retrieving revision 1.31
diff -u -r1.31 file.inc
--- components/file.inc	7 Feb 2011 03:51:08 -0000	1.31
+++ components/file.inc	18 Feb 2011 23:40:51 -0000
@@ -307,8 +307,6 @@
     '#theme_wrappers' => array(),
   );
   $element['#webform_component'] = $component;
-  $element['#webform_required'] = $component['mandatory'];
-  $element['#webform_form_key'] = $form_key;
   $element['#weight'] = $component['weight'];
   $element['#title'] = $filter ? _webform_filter_xss($component['name']) : $component['name'];
   $element['#title_display'] = $component['extra']['title_display'] ? $component['extra']['title_display'] : 'before';
@@ -322,6 +320,12 @@
     $element[$form_key]['#size'] = $component['extra']['width'];
   }
 
+  // Handles the asterisk for mandatory fields. Note that this is only on the
+  // wrapper, not on the file field itself. We handle validation separately.
+  if ($component['mandatory']) {
+    $element['#required'] = TRUE;
+  }
+
   // Add a hidden element to store the FID for new files.
   $element['_fid'] = array(
     '#type' => 'hidden',
@@ -355,11 +359,6 @@
     $element[$firstchild]['#description'] = '<div class="webform-newfile-message">'. t('Uploading a new file will replace the current file.') . '</div>' . (isset($element[$firstchild]['#description']) ? $element[$firstchild]['#description'] : '');
   }
 
-  // Add the required asterisk.
-  if ($element['#webform_required']) {
-    $element[$element['#webform_form_key']]['#required'] = TRUE;
-  }
-
   return drupal_render_children($element);
 }
 
