Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.6
diff -u -p -r1.6 contact.pages.inc
--- modules/contact/contact.pages.inc	16 Jan 2008 22:56:21 -0000	1.6
+++ modules/contact/contact.pages.inc	10 Feb 2008 20:53:43 -0000
@@ -39,19 +39,20 @@ function contact_mail_page() {
   if (count($categories) > 0) {
     $form['#token'] = $user->uid ? $user->name . $user->mail : '';
     $form['contact_information'] = array('#value' => filter_xss_admin(variable_get('contact_form_information', t('You can leave a message using the contact form below.'))));
-    $form['name'] = array('#type' => 'textfield',
+    $form['contact_information']['#tree'] = TRUE;
+    $form['contact_information']['name'] = array('#type' => 'textfield',
       '#title' => t('Your name'),
       '#maxlength' => 255,
       '#default_value' => $user->uid ? $user->name : '',
       '#required' => TRUE,
     );
-    $form['mail'] = array('#type' => 'textfield',
+    $form['contact_information']['mail'] = array('#type' => 'textfield',
       '#title' => t('Your e-mail address'),
       '#maxlength' => 255,
       '#default_value' => $user->uid ? $user->mail : '',
       '#required' => TRUE,
     );
-    $form['subject'] = array('#type' => 'textfield',
+    $form['contact_information']['subject'] = array('#type' => 'textfield',
       '#title' => t('Subject'),
       '#maxlength' => 255,
       '#required' => TRUE,
@@ -63,7 +64,7 @@ function contact_mail_page() {
         $default_category = t('- Please choose -');
         $categories = array($default_category) + $categories;
       }
-      $form['cid'] = array('#type' => 'select',
+      $form['contact_information']['cid'] = array('#type' => 'select',
         '#title' => t('Category'),
         '#default_value' => $default_category,
         '#options' => $categories,
@@ -73,25 +74,25 @@ function contact_mail_page() {
     else {
       // If there is only one category, store its cid.
       $category_keys = array_keys($categories);
-      $form['cid'] = array('#type' => 'value',
+      $form['contact_information']['cid'] = array('#type' => 'value',
         '#value' => array_shift($category_keys),
       );
     }
-    $form['message'] = array('#type' => 'textarea',
+    $form['contact_information']['message'] = array('#type' => 'textarea',
       '#title' => t('Message'),
       '#required' => TRUE,
     );
     // We do not allow anonymous users to send themselves a copy
     // because it can be abused to spam people.
     if ($user->uid) {
-      $form['copy'] = array('#type' => 'checkbox',
+      $form['contact_information']['copy'] = array('#type' => 'checkbox',
         '#title' => t('Send yourself a copy.'),
       );
     }
     else {
-      $form['copy'] = array('#type' => 'value', '#value' => FALSE);
+      $form['contact_information']['copy'] = array('#type' => 'value', '#value' => FALSE);
     }
-    $form['submit'] = array('#type' => 'submit',
+    $form['contact_information']['submit'] = array('#type' => 'submit',
       '#value' => t('Send e-mail'),
     );
   }
@@ -105,11 +106,11 @@ function contact_mail_page() {
  * Validate the site-wide contact page form submission.
  */
 function contact_mail_page_validate($form, &$form_state) {
-  if (!$form_state['values']['cid']) {
+  if (!$form_state['values']['contact_information']['cid']) {
     form_set_error('category', t('You must select a valid category.'));
   }
-  if (!valid_email_address($form_state['values']['mail'])) {
-    form_set_error('mail', t('You must enter a valid e-mail address.'));
+  if (!valid_email_address($form_state['values']['contact_information']['mail'])) {
+    form_set_error("contact_information']['mail", t('You must enter a valid e-mail address.'));
   }
 }
 
@@ -119,7 +120,7 @@ function contact_mail_page_validate($for
 function contact_mail_page_submit($form, &$form_state) {
   global $language;
 
-  $values = $form_state['values'];
+  $values = $form_state['values']['contact_information'];
 
   // E-mail address of the sender: as the form field is a text field,
   // all instances of \r and \n have been automatically stripped from it.
