diff -urp /home/ben/hierarchical_select/hierarchical_select.module ./hierarchical_select.module --- /home/ben/hierarchical_select/hierarchical_select.module 2008-11-29 20:56:07.000000000 -0500 +++ ./hierarchical_select.module 2009-11-12 09:42:11.000000000 -0500 @@ -554,20 +554,22 @@ function hierarchical_select_process($el // This button and accompanying help text will be hidden when Javascript is // enabled. - $element['nojs'] = array( - '#prefix' => '
', - '#suffix' => '
', - ); - $element['nojs']['update_button'] = array( - '#type' => 'button', - '#value' => t('Update'), - '#attributes' => array('class' => 'update-button'), - ); - $element['nojs']['update_button_help_text'] = array( - '#value' => _hierarchical_select_nojs_helptext($config['dropbox']['status']), - '#prefix' => '
', - '#suffix' => '
', - ); + // Tendency to briefly flash this warning even though JavaScript enabled. + // And the update button doesn't work anyway. + // $element['nojs'] = array( + // '#prefix' => '
', + // '#suffix' => '
', + // ); + // $element['nojs']['update_button'] = array( + // '#type' => 'button', + // '#value' => t('Update'), + // '#attributes' => array('class' => 'update-button'), + // ); + // $element['nojs']['update_button_help_text'] = array( + // '#value' => _hierarchical_select_nojs_helptext($config['dropbox']['status']), + // '#prefix' => '
', + // '#suffix' => '
', + //); // Ensure the render order is correct. @@ -663,6 +665,14 @@ function hierarchical_select_after_build // Pass the hs_form_build_id to a custom submit function that will clear // the associated values from the cache. $form['#submit']['_hierarchical_select_submit'] = array($_POST['hs_form_build_id']); + // This could be done in form_alter but we've already hacked up this module. + // Without the conditions this affects node edit forms etc. + if (isset($form['#token']) && $form['#token'] == 'views_filters') { + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Go'), + ); + } return $form; } diff -urp /home/ben/hierarchical_select/modules/hs_content_taxonomy_views.module ./modules/hs_content_taxonomy_views.module --- /home/ben/hierarchical_select/modules/hs_content_taxonomy_views.module 2008-11-19 20:04:22.000000000 -0500 +++ ./modules/hs_content_taxonomy_views.module 2009-11-12 09:26:23.000000000 -0500 @@ -81,7 +81,7 @@ function hs_content_taxonomy_views_form_ // This is a GET form, so also render the flat select. 'render_flat_select' => 1, ); - hierarchical_select_common_config_apply($form["filter$id"], "content-taxonomy-views-$view->name-$vid", $defaults_override); + hierarchical_select_common_config_apply($form["filter$id"], "content-taxonomy-views-$view->name-$field_name", $defaults_override); // Inherit #required from the exposed filter settings. $form["filter$id"]['#required'] = !((bool) $view->exposed_filter[$id]['optional']); @@ -140,6 +140,9 @@ function hs_content_taxonomy_views_form_ } } } + if ('companies_node_form' == $form_id) { +// drupal_set_message('
'.var_export($form,TRUE).'
'); //@debug + } } /** @@ -455,5 +458,9 @@ function _hs_content_taxonomy_views_pars if (preg_match("/(content|content_taxonomy)_(field_[A-Za-z0-9_]+)\.(\\2_value|tid)/", $id, $matches)) { $field_name = $matches[2]; } + // Second test to get field name when field stored in the content_type table. + elseif ( preg_match("/(content_type_[A-Za-z0-9_]+)\.(field_[A-Za-z0-9_]+)_value/", $id, $matches) ) { + $field_name = $matches[2]; + } return $field_name; }