? project_issue_issue_edit_213037_6.patch
? project_issue_issue_edit_213037_7.patch
? project_issue_issue_edit_213037_8.patch
Index: C:\www\project_testing\drupal\sites\all\modules\project_issue\issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/issue.inc,v
retrieving revision 1.300
diff -u -p -r1.300 issue.inc
--- issue.inc	6 Mar 2008 05:31:02 -0000	1.300
+++ issue.inc	6 Mar 2008 15:27:19 -0000
@@ -872,13 +872,19 @@ function project_issue_validate(&$node) 
     elseif ($project = node_load($node->pid)) {
       if (module_exists('project_release') &&
           $releases = project_release_get_releases($project, 0)) {
-        empty($node->rid) and form_set_error('rid', t('You have to specify a valid version.'));
+        if (empty($node->rid)) {
+          form_set_error('rid', t('You have to specify a valid version.'));
+        }
       }
       if (isset($node->component) && !in_array($node->component, $project->components)) {
         $node->component = 0;
       }
-      empty($node->component) && form_set_error('component', t('You have to specify a valid component.'));
-      empty($node->category) && form_set_error('category', t('You have to specify a valid category.'));
+      if (empty($node->component)) {
+        form_set_error('component', t('You have to specify a valid component.'));
+      }
+      if (empty($node->category)) {
+        form_set_error('category', t('You have to specify a valid category.'));
+      }
     }
   }
 }
Index: C:\www\project_testing\drupal\sites\all\modules\project_issue\project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.84
diff -u -p -r1.84 project_issue.module
--- project_issue.module	5 Mar 2008 16:08:24 -0000	1.84
+++ project_issue.module	6 Mar 2008 16:43:09 -0000
@@ -745,14 +745,19 @@ function project_issue_issue_nodeapi(&$n
   global $user;
   switch ($op) {
     case 'validate':
-      $result = db_query('SELECT * FROM {project_issue_state} WHERE sid = %d ORDER BY weight', $node->sid);
-      $state = db_fetch_object($result);
-
-      // Check if user has access, or if status is default status and therefore available to all,
-      // or if user is original issue poster and poster is granted access.
-      // If none of these is true, set error.
-      if (!(user_access('set issue status '. str_replace("'", "", $state->name)) || ($node->sid == variable_get('project_issue_default_state', 1)) || ($state->author_has && ($user->uid == $node->uid)))) {
-        form_set_error('sid', t('Invalid issue status %status: you do not have permission to set this status', array('%status' => $state)));
+      // We only need to validate status if this is a new node
+      // because the metadata fields are not present on the
+      // issue edit form.
+      if (empty($node->nid)){
+        $result = db_query('SELECT * FROM {project_issue_state} WHERE sid = %d ORDER BY weight', $node->sid);
+        $state = db_fetch_object($result);
+
+        // Check if user has access, or if status is default status and therefore available to all,
+        // or if user is original issue poster and poster is granted access.
+        // If none of these is true, set error.
+        if (!(user_access('set issue status '. str_replace("'", "", $state->name)) || ($node->sid == variable_get('project_issue_default_state', 1)) || ($state->author_has && ($user->uid == $node->uid)))) {
+          form_set_error('sid', t('Invalid issue status: you do not have permission to set the status to %status.', array('%status' => $state->name)));
+        }
       }
       break;
     case 'view':
