vid); } // It's always handy to have the vocabulary by hand. $form['#vocabulary'] = $vocabulary; if (!isset($form_state['storage']['confirm'])) { // We are at the set up step. $tree = taxonomy_get_tree($vocabulary->vid); $term_branch_value = is_null($term) ? NULL : array($term->tid); if (variable_get('taxonomy_override_selector', FALSE) && module_exists('hs_taxonomy')) { // We use Hierarchical Select module if it's available and configured to // be used for taxonomy selects. $form['term_branch'] = array( '#type' => 'hierarchical_select', // @todo: figure out why #required => TRUE doesn't work. // As a matter of fact, this issue seems to cover our case. // http://drupal.org/node/1275862. //'#required' => TRUE, '#config' => array( 'module' => 'hs_taxonomy', 'params' => array( 'vid' => $vocabulary->vid, 'exclude_tid' => NULL, 'root_term' => FALSE, ), 'enforce_deepest' => 0, 'entity_count' => 0, 'require_entity' => 0, 'save_lineage' => 0, 'level_labels' => array( 'status' => 0, ), 'dropbox' => array( 'status' => 1, 'limit' => 0, ), 'editability' => array( 'status' => 0, ), 'resizable' => TRUE, 'render_flat_select' => 0, ), ); } else { // Falling back on a simple