### Eclipse Workspace Patch 1.0 #P Drupal-7-Dev Index: modules/aggregator/aggregator.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v retrieving revision 1.14 diff -u -r1.14 aggregator.admin.inc --- modules/aggregator/aggregator.admin.inc 16 Aug 2008 14:48:17 -0000 1.14 +++ modules/aggregator/aggregator.admin.inc 25 Aug 2008 12:46:28 -0000 @@ -229,8 +229,6 @@ function aggregator_form_opml(&$form_state) { $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval'); - $form['#attributes'] = array('enctype' => "multipart/form-data"); - $form['upload'] = array( '#type' => 'file', '#title' => t('OPML File'), Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.613 diff -u -r1.613 system.module --- modules/system/system.module 21 Aug 2008 19:36:38 -0000 1.613 +++ modules/system/system.module 25 Aug 2008 12:46:32 -0000 @@ -288,6 +288,7 @@ $type['file'] = array( '#input' => TRUE, '#size' => 60, + '#enctype' => TRUE, ); Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.85 diff -u -r1.85 system.admin.inc --- modules/system/system.admin.inc 21 Aug 2008 19:36:38 -0000 1.85 +++ modules/system/system.admin.inc 25 Aug 2008 12:46:30 -0000 @@ -517,7 +517,6 @@ } } } - $form['#attributes'] = array('enctype' => 'multipart/form-data'); $form = system_settings_form($form); // We don't want to call system_settings_form_submit(), so change #submit. Index: modules/user/user.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v retrieving revision 1.15 diff -u -r1.15 user.pages.inc --- modules/user/user.pages.inc 21 Aug 2008 19:36:39 -0000 1.15 +++ modules/user/user.pages.inc 25 Aug 2008 12:46:33 -0000 @@ -246,7 +246,6 @@ '#submit' => array('user_edit_delete_submit'), ); } - $form['#attributes']['enctype'] = 'multipart/form-data'; return $form; } Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.281 diff -u -r1.281 form.inc --- includes/form.inc 17 Aug 2008 11:08:23 -0000 1.281 +++ includes/form.inc 25 Aug 2008 12:46:26 -0000 @@ -840,7 +840,7 @@ * was clicked when the form was submitted, as well as the sanitized * $_POST data. */ -function form_builder($form_id, $form, &$form_state) { +function form_builder($form_id, &$form, &$form_state) { static $complete_form, $cache; // Initialize as unprocessed. @@ -933,9 +933,15 @@ $cache = $form['#cache']; } // We are on the top form, we can copy back #cache if it's set. - if (isset($form['#type']) && $form['#type'] == 'form' && isset($cache)) { - $form['#cache'] = TRUE; + if (isset($form['#type']) && $form['#type'] == 'form') { + if(isset($cache)) { + $form['#cache'] = TRUE; + } + if (is_array($complete_form['#attributes'])) { + $form['#attributes'] = array_merge((array) $form['#attributes'], $complete_form['#attributes']); + } } + return $form; } @@ -944,7 +950,7 @@ * can be processed and rendered. Also, execute any #process handlers * attached to a specific element. */ -function _form_builder_handle_input_element($form_id, &$form, &$form_state, $complete_form) { +function _form_builder_handle_input_element($form_id, &$form, &$form_state, &$complete_form) { if (!isset($form['#name'])) { $name = array_shift($form['#parents']); $form['#name'] = $name; @@ -962,7 +968,10 @@ if (!isset($form['#id'])) { $form['#id'] = form_clean_id('edit-' . implode('-', $form['#parents'])); } - + if (isset($form['#enctype'])) { + $complete_form['#attributes'] = array_merge(array('enctype' => "multipart/form-data"), (array) $complete_form['#attributes']); + } + unset($edit); if (!empty($form['#disabled'])) { $form['#attributes']['disabled'] = 'disabled'; Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.180 diff -u -r1.180 locale.inc --- includes/locale.inc 21 Aug 2008 19:36:36 -0000 1.180 +++ includes/locale.inc 25 Aug 2008 12:46:28 -0000 @@ -637,7 +637,6 @@ ), ); $form['import']['submit'] = array('#type' => 'submit', '#value' => t('Import')); - $form['#attributes']['enctype'] = 'multipart/form-data'; return $form; } Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.205 diff -u -r1.205 upload.module --- modules/upload/upload.module 24 Jul 2008 16:25:19 -0000 1.205 +++ modules/upload/upload.module 25 Aug 2008 12:46:32 -0000 @@ -255,7 +255,6 @@ } else { $form['attachments']['wrapper'] += _upload_form($node); - $form['#attributes']['enctype'] = 'multipart/form-data'; } } $form['#submit'][] = 'upload_node_form_submit';