Index: issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/issue.inc,v
retrieving revision 1.140
diff -u -r1.140 issue.inc
--- issue.inc	14 Dec 2005 19:05:10 -0000	1.140
+++ issue.inc	10 Jan 2006 22:09:57 -0000
@@ -360,10 +360,11 @@
       $releases = array(t('<none>')) + $releases;
     }
     $components = array();
+    $node->component = $node->component ? $node->component : $_POST['edit']['component'];
     if ($project->components) {
-      $components = array(t('<none>'));
+      $components = array('0' => t('<none>'));
       foreach ($project->components as $component) {
-        $components[$component] = $component;
+        $components[trim($component)] = $component;
       }
     }
     $categories = array_merge(array(t('<none>')), project_issue_category(0, 0));
@@ -554,8 +555,16 @@
         }
         empty($form_values['rid']) and form_set_error('rid', t('You have to specify a valid version.'));
       }
-      if ($form_values['component'] && !in_array($form_values['component'], $project->components)) {
-        $form_values['component'] = 0;
+      // Loop through and trim because there is a trailing \n eles compare will never work.
+      if($form_values['component']) {
+        foreach($project->components as $k => $component) {
+          if($form_values['component'] == trim($component)) {
+            $found = TRUE;
+          }
+        }
+        if(!$found) {
+          $form_values['component'] = 0;
+        }
       }
 
       empty($form_values['component']) and form_set_error('component', t('You have to specify a valid component.'));
