Index: comment.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/project_issue/comment.inc,v
retrieving revision 1.138
diff -u -r1.138 comment.inc
--- comment.inc	27 Jan 2009 04:57:22 -0000	1.138
+++ comment.inc	27 Jan 2009 11:29:32 -0000
@@ -101,6 +101,12 @@
 function project_issue_form_comment_form_alter(&$form, &$form_state) {
   $nid = $form['nid']['#value'];
   $node = node_load($nid);
+
+  // Allows only project_issue
+  if ($node->type != 'project_issue') {
+    return;
+  }
+  
   $project = node_load(array('nid' => $node->project_issue['pid'], 'type' => 'project_project'));
 
   $form['#validate'][] = 'project_issue_form_comment_validate';
Index: issue.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/project_issue/issue.inc,v
retrieving revision 1.332
diff -u -r1.332 issue.inc
--- issue.inc	27 Jan 2009 04:57:22 -0000	1.332
+++ issue.inc	27 Jan 2009 11:32:32 -0000
@@ -507,6 +507,7 @@
         $node->project_issue['pid'] = db_result(db_query(db_rewrite_sql("SELECT p.nid FROM {project_projects} p WHERE p.uri = '%s'", 'p'), $pid));
       }
     }
+    $pid = $node->project_issue['pid'];
   }
 
   if (empty($pid)) {
@@ -523,7 +524,7 @@
   else {
     $allow_metadata_changes = empty($node->nid);
   }
-
+  
   // Load the project and initialize some support arrays.
   $project = node_load($pid);
   if ($project->type != 'project_project') {
@@ -553,7 +554,7 @@
     $states = project_issue_state(0, true, $node->nid && ($node->uid == $user->uid), $node->project_issue['sid']);
     $assigned = project_issue_assigned_choices($node);
   }
-
+  
   // Display the site-wide and/or per-project help text.
   $site_help = trim(variable_get('project_issue_site_help', ''));
   if (!empty($site_help)) {

