Index: advpoll.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advpoll/advpoll.module,v
retrieving revision 1.21.2.74
diff -u -p -r1.21.2.74 advpoll.module
--- advpoll.module	10 Oct 2007 09:37:38 -0000	1.21.2.74
+++ advpoll.module	10 Oct 2007 16:13:56 -0000
@@ -278,7 +278,7 @@ function advpoll_form($node, $form_value
     $form['question'] = array(
       '#type' => 'textfield',
       '#title' => t('Question'),
-      '#default_value' => $node->question,
+      '#default_value' => isset($node->question) ? $node->question : '',
       '#maxlength' => 255,
     );
   }
@@ -362,7 +362,7 @@ function advpoll_form($node, $form_value
   $form['settings']['max_choices'] = array(
     '#type' => 'select',
     '#title' => t('Maximum choices'),
-    '#default_value' => ($node->max_choices ? $node->max_choices : variable_get('advpoll_max_choices_'. $type->type, ADVPOLL_MAX_CHOICES)),
+    '#default_value' => isset($node->max_choices) ? $node->max_choices : variable_get('advpoll_max_choices_'. $type->type, ADVPOLL_MAX_CHOICES),
     '#options' => $max_choice_list,
     '#DANGEROUS_SKIP_CHECK' => TRUE, // Allow jQuery to add new options
     '#description' => t('Limits the total number of choices voters may select.')
@@ -375,7 +375,7 @@ function advpoll_form($node, $form_value
       '#type' => 'select',
       '#title' => t('Algorithm'),
       '#options' => $voting_algorithms,
-      '#default_value' => $node->algorithm ? $node->algorithm : variable_get('advpoll_algorithm_'. $type->type, key($voting_algorithms)),
+      '#default_value' => isset($node->algorithm) ? $node->algorithm : variable_get('advpoll_algorithm_'. $type->type, key($voting_algorithms)),
       '#description' => t('Voting algorithm to use to calculate the winner.'),
     );
   }
@@ -402,7 +402,7 @@ function advpoll_form($node, $form_value
     '#description' => t('The date that the poll opens. Format: %time. Leave blank if you want the poll to open now.', array('%time' => $time)),
     '#size' => 25,
     '#maxlength' => 25,
-    '#default_value' => $node->start_date ? format_date($node->start_date, 'custom', 'Y-m-d H:i:s O') : $default_start_date,
+    '#default_value' => isset($node->start_date) ? format_date($node->start_date, 'custom', 'Y-m-d H:i:s O') : $default_start_date,
   );
   $form['settings']['end_date'] = array(
     '#type' => 'textfield',
@@ -410,7 +410,7 @@ function advpoll_form($node, $form_value
     '#description' => t('The date that the poll closes. Format: %time. Leave blank if you do not want the poll to close automatically.', array('%time' => $time)),
     '#size' => 25,
     '#maxlength' => 25,
-    '#default_value' => $node->end_date ? format_date($node->end_date, 'custom', 'Y-m-d H:i:s O') : $default_end_date,
+    '#default_value' => isset($node->end_date) ? format_date($node->end_date, 'custom', 'Y-m-d H:i:s O') : $default_end_date,
   );
   
   // Settings available for users with 'administer polls' permission.
