Index: primary_term/primary_term.module
===================================================================
--- primary_term/primary_term.module	(revision 1555)
+++ primary_term/primary_term.module	(working copy)
@@ -90,17 +90,31 @@ function primary_term_form_alter(&$form,
         if(is_array($form['taxonomy'])){
           foreach($form['taxonomy'] as $vid => $vocab){
             if(in_array($vid, $vids)){
-              if(is_array($vocab['#options'])){
-                if(strlen(trim($vocab['#options']))){
-                  // not sure why we have the line below. from old days.
-                  // unset($vocab['#options'][0]);
+              //Support for Hierarchical Select module which removes the $vocab['#options'] data
+              $options = array();
+              if(is_array($vocab['#options'])) {
+                $options = $vocab['#options'];
+              }
+              
+              if(empty($options)) {
+                $tree = taxonomy_get_tree($vid);
+
+                if ($blank) {
+                  $options[''] = $blank;
+                }
+                if ($tree) {
+                  foreach ($tree as $term) {
+                    $choice = new stdClass();
+                    $choice->option = array($term->tid => str_repeat('-', $term->depth) . $term->name);
+                    $options[] = $choice;
+                  }
                 }
-                $terms = $terms + $vocab['#options'];
               }
+
+              $terms = array_merge($terms, $options);
             }
           }
-        }
-        
+        }        
         $types = node_get_types('names');
         $type = $types[$node->type];
         
