I created three exposed filters in a block. The first needs no arguments, the second uses the first filter's argument, and the third uses arguments from the first two filters. I have successfully setup the filters to do what I want and the work well with manual submissions, but when I enable auto-submit when exposed filter value changes, the auto-submit works for the first filter only. I created a separate view of non-reference exposed filters to test whether it was a Views bug or Views Reference Filter bug. The auto-submission of multiple exposed filters works as expected when no reference filters are used, so I believe this is the module with the bug.
Here is how my view is setup:
$view = new view();
$view->name = 'test_dropdown2';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'taxonomy_term_data';
$view->human_name = 'test dropdown2';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['distinct'] = TRUE;
$handler->display->display_options['query']['options']['pure_distinct'] = TRUE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['expose_sort_order'] = FALSE;
$handler->display->display_options['exposed_form']['options']['autosubmit'] = TRUE;
$handler->display->display_options['exposed_form']['options']['autosubmit_hide'] = FALSE;
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'entityreference_style';
$handler->display->display_options['style_options']['search_fields'] = array(
'name' => 'name',
);
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: Taxonomy term: Taxonomy term using Year */
$handler->display->display_options['relationships']['reverse_field_motorcycle_year_taxonomy_term']['id'] = 'reverse_field_motorcycle_year_taxonomy_term';
$handler->display->display_options['relationships']['reverse_field_motorcycle_year_taxonomy_term']['table'] = 'taxonomy_term_data';
$handler->display->display_options['relationships']['reverse_field_motorcycle_year_taxonomy_term']['field'] = 'reverse_field_motorcycle_year_taxonomy_term';
/* Field: Taxonomy term: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Field: Taxonomy term: Term ID */
$handler->display->display_options['fields']['tid']['id'] = 'tid';
$handler->display->display_options['fields']['tid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['tid']['field'] = 'tid';
$handler->display->display_options['fields']['tid']['label'] = '';
$handler->display->display_options['fields']['tid']['exclude'] = TRUE;
$handler->display->display_options['fields']['tid']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['tid']['separator'] = '';
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter']['id'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['reference_display'] = 'motorcycles_used_in_products:entityreference_1';
/* Display: Year Options */
$handler = $view->new_display('entityreference', 'Year Options', 'entityreference_1');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'entityreference_style';
$handler->display->display_options['style_options']['search_fields'] = array(
'name' => 'name',
);
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'entityreference_fields';
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter']['id'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['relationship'] = 'reverse_field_motorcycle_year_taxonomy_term';
$handler->display->display_options['filters']['tid_entityreference_filter']['reference_display'] = 'motorcycles_used_in_products:entityreference_1';
/* Display: Make Options */
$handler = $view->new_display('entityreference', 'Make Options', 'entityreference_3');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'entityreference_style';
$handler->display->display_options['style_options']['search_fields'] = array(
'name' => 'name',
);
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'entityreference_fields';
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: Taxonomy term: Taxonomy term using Make */
$handler->display->display_options['relationships']['reverse_field_motorcycle_make_taxonomy_term']['id'] = 'reverse_field_motorcycle_make_taxonomy_term';
$handler->display->display_options['relationships']['reverse_field_motorcycle_make_taxonomy_term']['table'] = 'taxonomy_term_data';
$handler->display->display_options['relationships']['reverse_field_motorcycle_make_taxonomy_term']['field'] = 'reverse_field_motorcycle_make_taxonomy_term';
/* Relationship: Field: Year (field_motorcycle_year) */
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['id'] = 'field_motorcycle_year_tid';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['table'] = 'field_data_field_motorcycle_year';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['field'] = 'field_motorcycle_year_tid';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['relationship'] = 'reverse_field_motorcycle_make_taxonomy_term';
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: Taxonomy term: Term ID */
$handler->display->display_options['arguments']['tid']['id'] = 'tid';
$handler->display->display_options['arguments']['tid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['arguments']['tid']['field'] = 'tid';
$handler->display->display_options['arguments']['tid']['relationship'] = 'field_motorcycle_year_tid';
$handler->display->display_options['arguments']['tid']['default_action'] = 'empty';
$handler->display->display_options['arguments']['tid']['exception']['value'] = '';
$handler->display->display_options['arguments']['tid']['default_argument_type'] = 'taxonomy_tid';
$handler->display->display_options['arguments']['tid']['default_argument_skip_url'] = TRUE;
$handler->display->display_options['arguments']['tid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['tid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['tid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['tid']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['tid']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['tid']['validate_options']['vocabularies'] = array(
'motorcycle_years' => 'motorcycle_years',
);
$handler->display->display_options['arguments']['tid']['validate']['fail'] = 'empty';
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter']['id'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['relationship'] = 'reverse_field_motorcycle_make_taxonomy_term';
$handler->display->display_options['filters']['tid_entityreference_filter']['reference_display'] = 'test_dropdown:entityreference_2';
/* Display: Model Options */
$handler = $view->new_display('entityreference', 'Model Options', 'entityreference_5');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'entityreference_style';
$handler->display->display_options['style_options']['search_fields'] = array(
'name' => 'name',
);
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'entityreference_fields';
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: Taxonomy term: Taxonomy term using Model */
$handler->display->display_options['relationships']['reverse_field_motorcycle_model_taxonomy_term']['id'] = 'reverse_field_motorcycle_model_taxonomy_term';
$handler->display->display_options['relationships']['reverse_field_motorcycle_model_taxonomy_term']['table'] = 'taxonomy_term_data';
$handler->display->display_options['relationships']['reverse_field_motorcycle_model_taxonomy_term']['field'] = 'reverse_field_motorcycle_model_taxonomy_term';
/* Relationship: Field: Year (field_motorcycle_year) */
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['id'] = 'field_motorcycle_year_tid';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['table'] = 'field_data_field_motorcycle_year';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['field'] = 'field_motorcycle_year_tid';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['relationship'] = 'reverse_field_motorcycle_model_taxonomy_term';
/* Relationship: Field: Make (field_motorcycle_make) */
$handler->display->display_options['relationships']['field_motorcycle_make_tid']['id'] = 'field_motorcycle_make_tid';
$handler->display->display_options['relationships']['field_motorcycle_make_tid']['table'] = 'field_data_field_motorcycle_make';
$handler->display->display_options['relationships']['field_motorcycle_make_tid']['field'] = 'field_motorcycle_make_tid';
$handler->display->display_options['relationships']['field_motorcycle_make_tid']['relationship'] = 'reverse_field_motorcycle_model_taxonomy_term';
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: Taxonomy term: Term ID */
$handler->display->display_options['arguments']['tid']['id'] = 'tid';
$handler->display->display_options['arguments']['tid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['arguments']['tid']['field'] = 'tid';
$handler->display->display_options['arguments']['tid']['relationship'] = 'field_motorcycle_year_tid';
$handler->display->display_options['arguments']['tid']['default_action'] = 'empty';
$handler->display->display_options['arguments']['tid']['exception']['value'] = '';
$handler->display->display_options['arguments']['tid']['default_argument_type'] = 'taxonomy_tid';
$handler->display->display_options['arguments']['tid']['default_argument_skip_url'] = TRUE;
$handler->display->display_options['arguments']['tid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['tid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['tid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['tid']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['tid']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['tid']['validate_options']['vocabularies'] = array(
'motorcycle_years' => 'motorcycle_years',
);
$handler->display->display_options['arguments']['tid']['validate']['fail'] = 'empty';
/* Contextual filter: Taxonomy term: Term ID */
$handler->display->display_options['arguments']['tid_1']['id'] = 'tid_1';
$handler->display->display_options['arguments']['tid_1']['table'] = 'taxonomy_term_data';
$handler->display->display_options['arguments']['tid_1']['field'] = 'tid';
$handler->display->display_options['arguments']['tid_1']['relationship'] = 'field_motorcycle_make_tid';
$handler->display->display_options['arguments']['tid_1']['default_action'] = 'empty';
$handler->display->display_options['arguments']['tid_1']['exception']['value'] = '';
$handler->display->display_options['arguments']['tid_1']['default_argument_type'] = 'taxonomy_tid';
$handler->display->display_options['arguments']['tid_1']['default_argument_skip_url'] = TRUE;
$handler->display->display_options['arguments']['tid_1']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['tid_1']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['tid_1']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['tid_1']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['tid_1']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['tid_1']['validate_options']['vocabularies'] = array(
'motorcycle_makes' => 'motorcycle_makes',
);
$handler->display->display_options['arguments']['tid_1']['validate']['fail'] = 'empty';
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter']['id'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['relationship'] = 'reverse_field_motorcycle_model_taxonomy_term';
$handler->display->display_options['filters']['tid_entityreference_filter']['reference_display'] = 'test_dropdown:entityreference_4';
/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: Field: Year (field_motorcycle_year) */
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['id'] = 'field_motorcycle_year_tid';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['table'] = 'field_data_field_motorcycle_year';
$handler->display->display_options['relationships']['field_motorcycle_year_tid']['field'] = 'field_motorcycle_year_tid';
/* Relationship: Field: Make (field_motorcycle_make) */
$handler->display->display_options['relationships']['field_motorcycle_make_tid']['id'] = 'field_motorcycle_make_tid';
$handler->display->display_options['relationships']['field_motorcycle_make_tid']['table'] = 'field_data_field_motorcycle_make';
$handler->display->display_options['relationships']['field_motorcycle_make_tid']['field'] = 'field_motorcycle_make_tid';
/* Relationship: Taxonomy term: Model (field_motorcycle_model) */
$handler->display->display_options['relationships']['field_motorcycle_model_tid']['id'] = 'field_motorcycle_model_tid';
$handler->display->display_options['relationships']['field_motorcycle_model_tid']['table'] = 'field_data_field_motorcycle_model';
$handler->display->display_options['relationships']['field_motorcycle_model_tid']['field'] = 'field_motorcycle_model_tid';
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter']['id'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter']['reference_display'] = 'motorcycles_used_in_products:entityreference_1';
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter_1']['id'] = 'tid_entityreference_filter_1';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['relationship'] = 'field_motorcycle_year_tid';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid_entityreference_filter_1']['expose']['operator_id'] = 'tid_entityreference_filter_1_op';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['expose']['label'] = 'Year';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['expose']['operator'] = 'tid_entityreference_filter_1_op';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['expose']['identifier'] = 'year_filter';
$handler->display->display_options['filters']['tid_entityreference_filter_1']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
3 => 0,
5 => 0,
6 => 0,
);
$handler->display->display_options['filters']['tid_entityreference_filter_1']['reference_display'] = 'test_dropdown2:entityreference_1';
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter_2']['id'] = 'tid_entityreference_filter_2';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['relationship'] = 'field_motorcycle_make_tid';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid_entityreference_filter_2']['expose']['operator_id'] = 'tid_entityreference_filter_2_op';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['expose']['label'] = 'Make';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['expose']['operator'] = 'tid_entityreference_filter_2_op';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['expose']['identifier'] = 'make_filter';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
3 => 0,
5 => 0,
6 => 0,
);
$handler->display->display_options['filters']['tid_entityreference_filter_2']['reference_display'] = 'test_dropdown2:entityreference_3';
$handler->display->display_options['filters']['tid_entityreference_filter_2']['reference_arguments'] = '[year_filter]';
/* Filter criterion: Taxonomy term: Term (reference filter) */
$handler->display->display_options['filters']['tid_entityreference_filter_3']['id'] = 'tid_entityreference_filter_3';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['field'] = 'tid_entityreference_filter';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['relationship'] = 'field_motorcycle_model_tid';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid_entityreference_filter_3']['expose']['operator_id'] = 'tid_entityreference_filter_3_op';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['expose']['label'] = 'Model';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['expose']['operator'] = 'tid_entityreference_filter_3_op';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['expose']['identifier'] = 'model_filter';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['expose']['remember_roles'] = array(
2 => 0,
1 => 0,
3 => 0,
5 => 0,
6 => 0,
);
$handler->display->display_options['filters']['tid_entityreference_filter_3']['reference_display'] = 'test_dropdown2:entityreference_5';
$handler->display->display_options['filters']['tid_entityreference_filter_3']['reference_arguments'] = '[year_filter]/[make_filter]';
Comments
Comment #1
emagray1 commentedAfter trying a few dozen other configurations, and learning a few dozen more ways that it doesn't work, I finally succeeded!!!!! =D
Hopefully I will find some time soon to create a tutorial for anyone having issues getting this module working for them.
Comment #2
emagray1 commentedHoping to help supply much needed documentation for this module now that I finally figured out how it works.
Comment #3
maximpodorov commentedGreat. It would be very useful.
Comment #4
MrsWho commentedCould you provide assistance on getting the second filter to obey the first? I haven't found the right argument value yet to make it work.
Updated: nevermind, got it working. For anyone else needing help, see screenshots over at this issue.