? modules/project/dif
? modules/project/project_issue_2page.patch
Index: modules/project/comment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/comment.inc,v
retrieving revision 1.64
diff -u -F^f -r1.64 comment.inc
--- modules/project/comment.inc	24 Apr 2006 14:33:09 -0000	1.64
+++ modules/project/comment.inc	24 Apr 2006 14:40:38 -0000
@@ -57,7 +57,7 @@ function project_comment_form(&$edit, &$
   $form['project_issue_form']['#prefix'] = '<div class="node-form"><div class="standard">';
   $form['project_issue_form']['#suffix'] = '</div></div>';
   $form['project_issue_form'] = project_issue_form($edit, $param);
-  $form['project_issue_form']['issue_details']['body']['#required'] = FALSE;
+  _project_issue_form_add_required_fields($form['project_issue_form'], FALSE);
   if ($edit->cid) {
     $form['cid']= array('#type' => 'hidden', '#value' => $edit->cid);
   }
Index: modules/project/issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/issue.inc,v
retrieving revision 1.167
diff -u -F^f -r1.167 issue.inc
--- modules/project/issue.inc	22 Apr 2006 21:14:57 -0000	1.167
+++ modules/project/issue.inc	24 Apr 2006 14:40:38 -0000
@@ -381,7 +381,6 @@ function project_issue_form(&$node, &$pa
       '#title' => t('Project'),
       '#default_value' => $node->pid,
       '#options' => $projects,
-      '#required' => TRUE,
     );
     if ($releases) {
       $form['project_info']['rid'] = array(
@@ -389,7 +388,6 @@ function project_issue_form(&$node, &$pa
         '#title' => t('Version'),
         '#default_value' => $node->rid,
         '#options' => $releases,
-        '#required' => TRUE,
       );
     }
     $form['project_info']['component'] = array(
@@ -397,7 +395,6 @@ function project_issue_form(&$node, &$pa
       '#title' => t('Component'),
       '#default_value' => $node->component,
       '#options' => $components,
-      '#required' => TRUE,
     );
 
     $form['issue_info'] = array(
@@ -411,7 +408,6 @@ function project_issue_form(&$node, &$pa
       '#title' => t('Category'),
       '#default_value' => $node->category ? $node->category : arg(4),
       '#options' => $categories,
-      '#required' => TRUE,
     );
     $form['issue_info']['priority'] = array(
       '#type' => 'select',
@@ -456,14 +452,12 @@ function project_issue_form(&$node, &$pa
       '#default_value' => $node->title,
       '#size' => 60,
       '#maxlength' => 128,
-      '#required' => TRUE,
     );
     $form['issue_details']['body'] = array(
       '#type' => 'textarea',
       '#title' => t('Description'),
       '#default_value' => $node->body,
       '#rows' => 10,
-      '#required' => TRUE,
     );
     $form['issue_details']['format'] = filter_form($node->format);
     $form['issue_details']['file_issue'] = array(
@@ -502,9 +496,9 @@ function project_issue_form_pre_render($
       $form['page']['#value'] = $form['page']['#value'] + 1;
     }
 
-    // If we're on the first page, we want to convert 'preview' into a
-    // 'next' button and hide 'submit', otherwise, we want the default.
     if ($form['page']['#value'] == 1) {
+      // If we're on the first page, we want to convert 'preview' into
+      // a 'next' button and hide 'submit'.
       $form['preview'] = array(
         '#type' => 'button',
         '#value' => t('Next'),
@@ -515,6 +509,46 @@ function project_issue_form_pre_render($
         '#value' => 'hidden',
       );
     }
+    else {
+      /*
+        We're on page 2.  In this case, we want all the default
+        buttons.  Furthermore, we must now set the #required attribute
+        on all the fields that are now in the form (which are only
+        added once we know the project from page #1 or from a direct
+        link), so that when we now attempt to validate the input (and
+        display the form), these fields will be required.
+      */
+      _project_issue_form_add_required_fields($form, TRUE);
+    }
+  }
+}
+
+/**
+ * Private helper method to set the '#required' attribute to TRUE for
+ * all the fields that should be required on the issue form.  These
+ * fields can't be set to required from project_issue_form() because
+ * this is a 2 page form, and so the FAPI validation code would mark
+ * them all as an error as soon as the user lands on page 2.
+ * Therefore, they're set to required by the pre_render hook (after
+ * initially validating the page, but before it is displayed).  This
+ * This is a separate method so that it can also be called from
+ * comment.inc, which shares the project_issue_form() code, but
+ * doesn't use it as a 2-page form, so we want these fields to be
+ * required right away in that case.
+ *
+ * @param $form
+ *   Reference to the form to modify
+ * @param $needs_body
+ *   Boolean that specifies if the 'body' field should be required
+ */
+function _project_issue_form_add_required_fields(&$form, $needs_body) {
+  $form['project_info']['pid']['#required'] = TRUE;
+  $form['project_info']['rid']['#required'] = TRUE;
+  $form['project_info']['component']['#required'] = TRUE;
+  $form['issue_info']['category']['#required'] = TRUE;
+  $form['issue_details']['title']['#required'] = TRUE;
+  if ($needs_body) {
+    $form['issue_details']['body']['#required'] = TRUE;
   }
 }
 
@@ -540,6 +574,7 @@ function project_issue_node_form_validat
       }
       empty($form_values['component']) && form_set_error('component', t('You have to specify a valid component.'));
       empty($form_values['category']) && form_set_error('category', t('You have to specify a valid category.'));
+      empty($form_values['title']) && form_set_error('title', t('You have to specify a valid title.'));
       empty($form_values['body']) && form_set_error('body', t('You have to specify a valid description.'));
 
       $file = file_check_upload('file_issue');
