Index: modules/project/project.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/project/project.inc,v
retrieving revision 1.75.2.16
diff -u -r1.75.2.16 project.inc
--- modules/project/project.inc	26 Jul 2006 07:18:01 -0000	1.75.2.16
+++ modules/project/project.inc	16 Dec 2006 22:42:12 -0000
@@ -11,7 +11,7 @@
   ** Allow the following fields to be initialized via $_GET
   */
   foreach (array('uri', 'mail', 'homepage') as $field) {
-    if ($_GET['edit'][$field]) {
+    if (!empty($_GET['edit'][$field])) {
       $node->$field = $_GET['edit'][$field];
     }
   }
@@ -85,23 +85,23 @@
   $form['project']['title'] = array(
     '#type' => 'textfield',
     '#title' => t('Full project name'),
-    '#default_value' => $node->title,
+    '#default_value' => isset($node->title) ? $node->title : NULL,
     '#maxlength' => 128,
     '#required' => TRUE,
   );
   $form['project']['body'] = array(
     '#type' => 'textarea',
     '#title' => t('Full description'),
-    '#default_value' => $node->body,
+    '#default_value' => isset($node->body) ? $node->body : NULL,
     '#cols' => 40,
     '#rows' => 10,
     '#required' => TRUE,
   );
-  $form['project']['format'] = filter_form($node->format); 
+  $form['project']['format'] = filter_form(isset($node->format) ? $node->format : NULL); 
   $form['project']['uri'] = array(
     '#type' => 'textfield',
     '#title' => t('Short project name'),
-    '#default_value' => $node->uri,
+    '#default_value' => isset($node->uri) ? $node->uri : NULL,
     '#size' => 40,
     '#maxlength' => 50,
     '#description' => t('This will be used to generate a /project/&lt;shortname&gt;/ URL for your project.'),
@@ -110,7 +110,7 @@
   $form['project']['mail'] = array(
     '#type' => 'textfield',
     '#title' => t('Project e-mail'),
-    '#default_value' => $node->mail ? $node->mail : $user->mail,
+    '#default_value' => !empty($node->mail) ? $node->mail : $user->mail,
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('E-mail address where the project owners can be contacted.'),
@@ -119,7 +119,7 @@
   $form['project']['homepage'] = array(
     '#type' => 'textfield',
     '#title' => t('Homepage'),
-    '#default_value' => $node->homepage,
+    '#default_value' => isset($node->homepage) ? $node->homepage : NULL,
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Link to project homepage.'),
@@ -127,7 +127,7 @@
   $form['project']['documentation'] = array(
     '#type' => 'textfield',
     '#title' => t('Documentation'),
-    '#default_value' => $node->documentation,
+    '#default_value' => isset($node->documentation) ? $node->documentation : NULL,
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Link to project documentation.'),
@@ -135,7 +135,7 @@
   $form['project']['license'] = array(
     '#type' => 'textfield',
     '#title' => t('License'),
-    '#default_value' => $node->license,
+    '#default_value' => isset($node->license) ? $node->license : NULL,
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Link to project license.'),
@@ -143,7 +143,7 @@
   $form['project']['screenshots'] = array(
     '#type' => 'textfield',
     '#title' => t('Screenshots'),
-    '#default_value' => $node->screenshots,
+    '#default_value' => isset($node->screenshots) ? $node->screenshots : NULL,
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Link to project screenshots.'),
@@ -151,7 +151,7 @@
   $form['project']['changelog'] = array(
     '#type' => 'textfield',
     '#title' => t('Changelog'),
-    '#default_value' => $node->changelog,
+    '#default_value' => isset($node->changelog) ? $node->changelog : NULL,
      '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Link to changelog.'),
@@ -159,7 +159,7 @@
   $form['project']['cvs'] = array(
     '#type' => 'textfield',
     '#title' => t('CVS tree'),
-    '#default_value' => $node->cvs,
+    '#default_value' => isset($node->cvs) ? $node->cvs : NULL,
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Link to webcvs/viewcvs.'),
@@ -167,7 +167,7 @@
   $form['project']['demo'] = array(
     '#type' => 'textfield',
     '#title' => t('Demo site'),
-    '#default_value' => $node->demo,
+    '#default_value' => isset($node->demo) ? $node->demo : NULL,
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Link to a live demo.'),
@@ -239,11 +239,11 @@
     form_set_error('mail_copy', $data);
   }
 
-  if (is_array($node->mail_copy_filter)) {
+  if (isset($node->mail_copy_filter) && is_array($node->mail_copy_filter)) {
     $node->mail_copy_filter = array_filter($node->mail_copy_filter, 'project_project_cleanup');
   }
 
-  if (is_array($node->mail_copy_filter_state)) {
+  if (isset($node->mail_copy_filter_state) && is_array($node->mail_copy_filter_state)) {
     $node->mail_copy_filter_state = array_filter($node->mail_copy_filter_state, 'project_project_cleanup');
   }
 
@@ -297,6 +297,7 @@
 
 function project_project_view(&$node, $teaser = false, $page = false) {
   $node = project_project_content($node, $teaser);
+  $output = '';
   if ($page) {
     // Breadcrumb navigation
     $breadcrumb[] = array('path' => 'node/'. $node->nid, 'title' => $node->title);
@@ -363,7 +364,7 @@
       $links[] = l(t('Support forum'), 'forum/' . $support_forum);
     }
 
-    if ($node->issues) {
+    if (!empty($node->issues)) {
       #$output .= '<p>'. t('If you think you have found a bug please check the list of existing bugs reported, if you do not find it please submit a new bug report. Remember to provide as much information as possible to make it easier for the developers to fix the issue.') .'</p>';
       $links[] = l(t('View pending bug reports'), 'project/issues/'. $node->uri, null, 'categories=bug', null);
       $links[] = l(t('View pending feature requests'), 'project/issues/'. $node->uri, null, 'categories=feature', null);
@@ -378,7 +379,7 @@
     // Developer section
     $links = array();
 
-    if ($node->issues) {
+    if (!empty($node->issues)) {
       #$output .= '<p>'. t('If you think you have found a bug please check the list of existing bugs reported, if you do not find it please submit a new bug report. Remember to provide as much information as possible to make it easier for the developers to fix the issue.') .'</p>';
       $links[] = l(t('View pending patches'), 'project/issues/'. $node->uri, null, 'states=8,13,14', null);
       $links[] = l(t('View available tasks'), 'project/issues/'. $node->uri, null, 'categories=task', null);
@@ -501,7 +502,7 @@
       }
     }
   }
-  return $node;
+  return isset($node) ? $node : NULL;
 }
 
 function project_developers($nid = 0) {
