Problem/Motivation

This is a follow-up to #2189321: Secondary options closed after submit if filter identifier is not left default.

The patch works well, however I have uncovered one issue. There is a problem when the View uses Ajax to submit filters, and one of the secondary options is an autocomplete taxonomy term field. In this scenario, Ajax returns a value of the field to be "All" when no filtering has been selected.

Therefore the secondary option fieldset opens when Ajax returns the form, even though the fieldset was never opened and no values were set by the user. This functionality is controlled in the following logic in better_exposed_filters_exposed_form_plugin.inc:

      foreach ($this->display->handler->get_handlers('filter') as $label => $filter) {
        if (!$filter->options['exposed']) {
          continue;
        }
        if (!empty($exposed_input[$filter->options['expose']['identifier']]) && $settings[$label]['more_options']['is_secondary']) {
          $secondary_collapse = FALSE;
          break;
        }
      }

Proposed resolution

There should be an extra check added to the conditional to determine if the value is not set to "All." This will ensure the fieldset stays closed when all values are being returned by default. This would be accomplished with the following adjustment:

      foreach ($this->display->handler->get_handlers('filter') as $label => $filter) {
        if (!$filter->options['exposed']) {
          continue;
        }
        if (!empty($exposed_input[$filter->options['expose']['identifier']]) && $exposed_input[$filter->options['expose']['identifier']] != 'All' && $settings[$label]['more_options']['is_secondary']) {
          $secondary_collapse = FALSE;
          break;
        }
      }

Comments

sgdev’s picture

Status: Active » Needs review
StatusFileSize
new771 bytes

Here is a patch for review.

sgdev’s picture

Just found another situation where this occurs. If an exposed filter is a date field, and the operator value is set to "in between," the value is not empty even when no information is entered by the user.

The value rendered into $exposed_input[$filter->options['expose']['identifier']] is an array, as follows (serialized):

a:2:{s:3:"min";a:1:{s:4:"date";s:0:"";}s:3:"max";a:1:{s:4:"date";s:0:"";}}

The min/max date values are empty, but the fact that the array exists makes the exposed input value not empty.

Additional code would be needed to support this, including checking if ['min']['date'] and ['max']['date'] exist, and if they do, checking if they are empty. Feels like the code in the exposed_form_alter function needs to be flexible enough to handle different types of non-standard fields (autocomplete, date range, etc.) as they are identified.

sgdev’s picture

Here is an updated patch. I've pulled the logic for determining if an exposed filter is empty into its own conditional. My thought is if that section becomes long enough, it might make sense to move it into a separate function.

Let me know any questions or feedback, thanks.

sgdev’s picture

Title: Secondary options open on Ajax submit when autocomplete value is defined as "All" » Secondary options open on Ajax submit when filters have unique empty value formats

Probably makes sense to rename this as something more generic.

sgdev’s picture

Identified another scenario that needed a condition. The previous patch included min/max for date fields, but also should include min/max for generic fields.

Please review the attached patch, thanks.

mikeker’s picture

Status: Needs review » Needs work

Thank you for the patch and my apologies for the delay in addressing it.

However, I wasn't able to reproduce your original issue -- that an auto-complete term field in as a secondary filter would cause the fieldset to open when other filter values were selected. There seem to be other issues with the autocomplete not working correctly but that could be from many different sources, including the theme layer. I haven't had a chance to investigate it yet.

I was able to reproduce the issue with date fields.

If you're still seeing the problem with autocomplete fields, can you attach an export of the view in question? Thanks.

sgdev’s picture

Yes, I'll be able to post a sample view in a couple of weeks. Wrapping up with a project at the moment. Thanks.

begun’s picture

I have encountered the same issue. In this case I am using a combination of select fields and checkboxes in the secondary filter fieldset. Because the default value of the select field is 'All', when the form is loaded the secondary options are displayed. This is because `$exposed_input[$filter->options['expose']['identifier']]` is not empty.

if (!empty($exposed_input[$filter->options['expose']['identifier']]) && $settings[$label]['more_options']['is_secondary']) {
          $secondary_collapse = FALSE;
          break;

If I change the exposed filter to use radio buttons/checkboxes the issue is resolved. It would seem that the plugin needs to be alter so that it the exposed filter widget is a select element, then it should only set `$secondary_collapse = FALSE`, if it is not using default value.

sgdev’s picture

Sorry, I had become busy with another project and didn't have a chance to post a sample view per your request in #6. Below is an example. If the patch I created in #5 is applied, there are no issues.

$view = new view();
$view->name = 'log_admin_2';
$view->description = 'Administrative page to review and access book logs.';
$view->tag = 'mysrc';
$view->base_table = 'entityform';
$view->human_name = 'Log - Admin 2';
$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['css_class'] = 'logs';
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
  3 => '3',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'better_exposed_filters';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Go';
$handler->display->display_options['exposed_form']['options']['bef'] = array(
  'general' => array(
    'allow_secondary' => 1,
    'secondary_label' => 'Advanced options',
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'field_book_title_value' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'is_secondary' => 0,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'field_last_name_value' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'is_secondary' => 0,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'field_first_name_value' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'is_secondary' => 0,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'field_short_name_value_3' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'is_secondary' => 1,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'field_school_term_id_value' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'bef_select_all_none' => FALSE,
      'bef_collapsible' => 0,
      'is_secondary' => 1,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'secondary_label' => NULL,
  'collapsible_label' => NULL,
  'combine_rewrite' => NULL,
  'reset_label' => NULL,
  'bef_filter_description' => NULL,
  'any_label' => NULL,
  'filter_rewrite_values' => NULL,
);
$handler->display->display_options['exposed_form']['options']['input_required'] = 0;
$handler->display->display_options['exposed_form']['options']['text_input_required_format'] = 'full_html';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '50';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
  'field_book_title' => 'field_book_title',
  'field_last_name' => 'field_last_name',
  'field_first_name' => 'field_first_name',
  'field_short_name_2' => 'field_short_name_2',
  'field_school_term_id' => 'field_school_term_id',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
  'field_book_title' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'field_last_name' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'field_first_name' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'field_short_name_2' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'field_school_term_id' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
);
/* Relationship: Entityform Submission: Books (field_book) */
$handler->display->display_options['relationships']['field_book_value']['id'] = 'field_book_value';
$handler->display->display_options['relationships']['field_book_value']['table'] = 'field_data_field_book';
$handler->display->display_options['relationships']['field_book_value']['field'] = 'field_book_value';
$handler->display->display_options['relationships']['field_book_value']['required'] = TRUE;
$handler->display->display_options['relationships']['field_book_value']['delta'] = '-1';
/* Relationship: Field collection item: Entity with the Books (field_book) */
$handler->display->display_options['relationships']['field_book_entityform']['id'] = 'field_book_entityform';
$handler->display->display_options['relationships']['field_book_entityform']['table'] = 'field_collection_item';
$handler->display->display_options['relationships']['field_book_entityform']['field'] = 'field_book_entityform';
$handler->display->display_options['relationships']['field_book_entityform']['relationship'] = 'field_book_value';
$handler->display->display_options['relationships']['field_book_entityform']['required'] = TRUE;
/* Relationship: Entityform Submission: User uid */
$handler->display->display_options['relationships']['user']['id'] = 'user';
$handler->display->display_options['relationships']['user']['table'] = 'entityform';
$handler->display->display_options['relationships']['user']['field'] = 'user';
$handler->display->display_options['relationships']['user']['required'] = TRUE;
/* Relationship: User: Profile - Main */
$handler->display->display_options['relationships']['profile']['id'] = 'profile';
$handler->display->display_options['relationships']['profile']['table'] = 'users';
$handler->display->display_options['relationships']['profile']['field'] = 'profile';
$handler->display->display_options['relationships']['profile']['relationship'] = 'user';
$handler->display->display_options['relationships']['profile']['ui_name'] = 'User: Profile - Main';
$handler->display->display_options['relationships']['profile']['label'] = 'Profile - Main';
$handler->display->display_options['relationships']['profile']['required'] = TRUE;
$handler->display->display_options['relationships']['profile']['bundle_types'] = array(
  'main' => 'main',
);
/* Relationship: User: Profile - Child */
$handler->display->display_options['relationships']['profile_1']['id'] = 'profile_1';
$handler->display->display_options['relationships']['profile_1']['table'] = 'users';
$handler->display->display_options['relationships']['profile_1']['field'] = 'profile';
$handler->display->display_options['relationships']['profile_1']['relationship'] = 'user';
$handler->display->display_options['relationships']['profile_1']['ui_name'] = 'User: Profile - Child';
$handler->display->display_options['relationships']['profile_1']['label'] = 'Profile - Child';
$handler->display->display_options['relationships']['profile_1']['bundle_types'] = array(
  'early_childhood' => 'early_childhood',
  'child' => 'child',
  'teen' => 'teen',
);
/* Relationship: Field: School (field_school) */
$handler->display->display_options['relationships']['field_school_tid']['id'] = 'field_school_tid';
$handler->display->display_options['relationships']['field_school_tid']['table'] = 'field_data_field_school';
$handler->display->display_options['relationships']['field_school_tid']['field'] = 'field_school_tid';
$handler->display->display_options['relationships']['field_school_tid']['relationship'] = 'profile_1';
/* Relationship: Taxonomy term: Parent term - School Type */
$handler->display->display_options['relationships']['parent_1']['id'] = 'parent_1';
$handler->display->display_options['relationships']['parent_1']['table'] = 'taxonomy_term_hierarchy';
$handler->display->display_options['relationships']['parent_1']['field'] = 'parent';
$handler->display->display_options['relationships']['parent_1']['relationship'] = 'field_school_tid';
$handler->display->display_options['relationships']['parent_1']['ui_name'] = 'Taxonomy term: Parent term - School Type';
$handler->display->display_options['relationships']['parent_1']['label'] = 'Parent - School Type';
/* Field: Field collection item: Book Title */
$handler->display->display_options['fields']['field_book_title']['id'] = 'field_book_title';
$handler->display->display_options['fields']['field_book_title']['table'] = 'field_data_field_book_title';
$handler->display->display_options['fields']['field_book_title']['field'] = 'field_book_title';
$handler->display->display_options['fields']['field_book_title']['relationship'] = 'field_book_value';
$handler->display->display_options['fields']['field_book_title']['label'] = 'Book';
/* Field: Profile: Last Name */
$handler->display->display_options['fields']['field_last_name']['id'] = 'field_last_name';
$handler->display->display_options['fields']['field_last_name']['table'] = 'field_data_field_last_name';
$handler->display->display_options['fields']['field_last_name']['field'] = 'field_last_name';
$handler->display->display_options['fields']['field_last_name']['relationship'] = 'profile';
$handler->display->display_options['fields']['field_last_name']['element_type'] = '0';
$handler->display->display_options['fields']['field_last_name']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_last_name']['element_wrapper_type'] = '0';
$handler->display->display_options['fields']['field_last_name']['element_default_classes'] = FALSE;
/* Field: Profile: First Name */
$handler->display->display_options['fields']['field_first_name']['id'] = 'field_first_name';
$handler->display->display_options['fields']['field_first_name']['table'] = 'field_data_field_first_name';
$handler->display->display_options['fields']['field_first_name']['field'] = 'field_first_name';
$handler->display->display_options['fields']['field_first_name']['relationship'] = 'profile';
$handler->display->display_options['fields']['field_first_name']['element_type'] = '0';
$handler->display->display_options['fields']['field_first_name']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_first_name']['element_wrapper_type'] = '0';
$handler->display->display_options['fields']['field_first_name']['element_default_classes'] = FALSE;
/* Field: Field: Short Name */
$handler->display->display_options['fields']['field_short_name_2']['id'] = 'field_short_name_2';
$handler->display->display_options['fields']['field_short_name_2']['table'] = 'field_data_field_short_name';
$handler->display->display_options['fields']['field_short_name_2']['field'] = 'field_short_name';
$handler->display->display_options['fields']['field_short_name_2']['relationship'] = 'field_school_tid';
$handler->display->display_options['fields']['field_short_name_2']['label'] = 'School';
$handler->display->display_options['fields']['field_short_name_2']['element_type'] = '0';
$handler->display->display_options['fields']['field_short_name_2']['element_wrapper_type'] = '0';
$handler->display->display_options['fields']['field_short_name_2']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_short_name_2']['type'] = 'text_plain';
/* Field: Taxonomy term: School Term Identification */
$handler->display->display_options['fields']['field_school_term_id']['id'] = 'field_school_term_id';
$handler->display->display_options['fields']['field_school_term_id']['table'] = 'field_data_field_school_term_id';
$handler->display->display_options['fields']['field_school_term_id']['field'] = 'field_school_term_id';
$handler->display->display_options['fields']['field_school_term_id']['relationship'] = 'field_school_tid';
$handler->display->display_options['fields']['field_school_term_id']['label'] = 'School Type';
$handler->display->display_options['fields']['field_school_term_id']['element_type'] = '0';
$handler->display->display_options['fields']['field_school_term_id']['element_wrapper_type'] = '0';
$handler->display->display_options['fields']['field_school_term_id']['element_default_classes'] = FALSE;
/* Sort criterion: Entityform Submission: Date changed */
$handler->display->display_options['sorts']['changed']['id'] = 'changed';
$handler->display->display_options['sorts']['changed']['table'] = 'entityform';
$handler->display->display_options['sorts']['changed']['field'] = 'changed';
$handler->display->display_options['sorts']['changed']['order'] = 'DESC';
/* Filter criterion: Entityform Submission: Entityform Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'entityform';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'book_log' => 'book_log',
);
$handler->display->display_options['filters']['type']['group'] = 1;
/* Filter criterion: Field collection item: Book Title (field_book_title) */
$handler->display->display_options['filters']['field_book_title_value']['id'] = 'field_book_title_value';
$handler->display->display_options['filters']['field_book_title_value']['table'] = 'field_data_field_book_title';
$handler->display->display_options['filters']['field_book_title_value']['field'] = 'field_book_title_value';
$handler->display->display_options['filters']['field_book_title_value']['relationship'] = 'field_book_value';
$handler->display->display_options['filters']['field_book_title_value']['operator'] = 'contains';
$handler->display->display_options['filters']['field_book_title_value']['group'] = 1;
$handler->display->display_options['filters']['field_book_title_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_book_title_value']['expose']['operator_id'] = 'field_book_title_value_op';
$handler->display->display_options['filters']['field_book_title_value']['expose']['label'] = 'Book';
$handler->display->display_options['filters']['field_book_title_value']['expose']['operator'] = 'field_book_title_value_op';
$handler->display->display_options['filters']['field_book_title_value']['expose']['identifier'] = 'field_book_title_value';
$handler->display->display_options['filters']['field_book_title_value']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
  7 => 0,
  10 => 0,
  8 => 0,
  9 => 0,
  4 => 0,
  5 => 0,
  11 => 0,
  6 => 0,
  15 => 0,
  14 => 0,
  13 => 0,
  12 => 0,
);
$handler->display->display_options['filters']['field_book_title_value']['expose']['autocomplete_filter'] = 1;
$handler->display->display_options['filters']['field_book_title_value']['expose']['autocomplete_items'] = '10';
$handler->display->display_options['filters']['field_book_title_value']['expose']['autocomplete_min_chars'] = '0';
$handler->display->display_options['filters']['field_book_title_value']['expose']['autocomplete_field'] = 'field_book_title';
$handler->display->display_options['filters']['field_book_title_value']['expose']['autocomplete_raw_suggestion'] = 1;
$handler->display->display_options['filters']['field_book_title_value']['expose']['autocomplete_raw_dropdown'] = 1;
$handler->display->display_options['filters']['field_book_title_value']['expose']['autocomplete_dependent'] = 0;
/* Filter criterion: Profile: Last Name (field_last_name) */
$handler->display->display_options['filters']['field_last_name_value']['id'] = 'field_last_name_value';
$handler->display->display_options['filters']['field_last_name_value']['table'] = 'field_data_field_last_name';
$handler->display->display_options['filters']['field_last_name_value']['field'] = 'field_last_name_value';
$handler->display->display_options['filters']['field_last_name_value']['relationship'] = 'profile';
$handler->display->display_options['filters']['field_last_name_value']['operator'] = 'contains';
$handler->display->display_options['filters']['field_last_name_value']['group'] = 1;
$handler->display->display_options['filters']['field_last_name_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_last_name_value']['expose']['operator_id'] = 'field_last_name_value_op';
$handler->display->display_options['filters']['field_last_name_value']['expose']['label'] = 'Last Name';
$handler->display->display_options['filters']['field_last_name_value']['expose']['operator'] = 'field_last_name_value_op';
$handler->display->display_options['filters']['field_last_name_value']['expose']['identifier'] = 'field_last_name_value';
$handler->display->display_options['filters']['field_last_name_value']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
  7 => 0,
  10 => 0,
  8 => 0,
  9 => 0,
  4 => 0,
  5 => 0,
  11 => 0,
  6 => 0,
  15 => 0,
  14 => 0,
  13 => 0,
  12 => 0,
);
$handler->display->display_options['filters']['field_last_name_value']['expose']['autocomplete_items'] = '10';
$handler->display->display_options['filters']['field_last_name_value']['expose']['autocomplete_min_chars'] = '0';
$handler->display->display_options['filters']['field_last_name_value']['expose']['autocomplete_field'] = 'field_last_name';
$handler->display->display_options['filters']['field_last_name_value']['expose']['autocomplete_raw_suggestion'] = 1;
$handler->display->display_options['filters']['field_last_name_value']['expose']['autocomplete_raw_dropdown'] = 1;
$handler->display->display_options['filters']['field_last_name_value']['expose']['autocomplete_dependent'] = 0;
/* Filter criterion: Profile: First Name (field_first_name) */
$handler->display->display_options['filters']['field_first_name_value']['id'] = 'field_first_name_value';
$handler->display->display_options['filters']['field_first_name_value']['table'] = 'field_data_field_first_name';
$handler->display->display_options['filters']['field_first_name_value']['field'] = 'field_first_name_value';
$handler->display->display_options['filters']['field_first_name_value']['relationship'] = 'profile';
$handler->display->display_options['filters']['field_first_name_value']['operator'] = 'contains';
$handler->display->display_options['filters']['field_first_name_value']['group'] = 1;
$handler->display->display_options['filters']['field_first_name_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_first_name_value']['expose']['operator_id'] = 'field_first_name_value_op';
$handler->display->display_options['filters']['field_first_name_value']['expose']['label'] = 'First Name';
$handler->display->display_options['filters']['field_first_name_value']['expose']['operator'] = 'field_first_name_value_op';
$handler->display->display_options['filters']['field_first_name_value']['expose']['identifier'] = 'field_first_name_value';
$handler->display->display_options['filters']['field_first_name_value']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
  7 => 0,
  10 => 0,
  8 => 0,
  9 => 0,
  4 => 0,
  5 => 0,
  11 => 0,
  6 => 0,
  15 => 0,
  14 => 0,
  13 => 0,
  12 => 0,
);
$handler->display->display_options['filters']['field_first_name_value']['expose']['autocomplete_items'] = '10';
$handler->display->display_options['filters']['field_first_name_value']['expose']['autocomplete_min_chars'] = '0';
$handler->display->display_options['filters']['field_first_name_value']['expose']['autocomplete_field'] = 'field_first_name';
$handler->display->display_options['filters']['field_first_name_value']['expose']['autocomplete_raw_suggestion'] = 1;
$handler->display->display_options['filters']['field_first_name_value']['expose']['autocomplete_raw_dropdown'] = 1;
$handler->display->display_options['filters']['field_first_name_value']['expose']['autocomplete_dependent'] = 0;
/* Filter criterion: Field: Short Name (field_short_name) */
$handler->display->display_options['filters']['field_short_name_value_3']['id'] = 'field_short_name_value_3';
$handler->display->display_options['filters']['field_short_name_value_3']['table'] = 'field_data_field_short_name';
$handler->display->display_options['filters']['field_short_name_value_3']['field'] = 'field_short_name_value';
$handler->display->display_options['filters']['field_short_name_value_3']['relationship'] = 'field_school_tid';
$handler->display->display_options['filters']['field_short_name_value_3']['operator'] = 'contains';
$handler->display->display_options['filters']['field_short_name_value_3']['group'] = 1;
$handler->display->display_options['filters']['field_short_name_value_3']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['operator_id'] = 'field_short_name_value_3_op';
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['label'] = 'School';
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['operator'] = 'field_short_name_value_3_op';
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['identifier'] = 'field_short_name_value_3';
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
  7 => 0,
  10 => 0,
  8 => 0,
  9 => 0,
  4 => 0,
  5 => 0,
  11 => 0,
  6 => 0,
  15 => 0,
  14 => 0,
  13 => 0,
  12 => 0,
);
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['autocomplete_filter'] = 1;
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['autocomplete_items'] = '10';
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['autocomplete_min_chars'] = '0';
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['autocomplete_field'] = 'field_short_name_2';
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['autocomplete_raw_suggestion'] = 1;
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['autocomplete_raw_dropdown'] = 1;
$handler->display->display_options['filters']['field_short_name_value_3']['expose']['autocomplete_dependent'] = 0;
/* Filter criterion: Taxonomy term: School Term Identification (field_school_term_id) */
$handler->display->display_options['filters']['field_school_term_id_value']['id'] = 'field_school_term_id_value';
$handler->display->display_options['filters']['field_school_term_id_value']['table'] = 'field_data_field_school_term_id';
$handler->display->display_options['filters']['field_school_term_id_value']['field'] = 'field_school_term_id_value';
$handler->display->display_options['filters']['field_school_term_id_value']['relationship'] = 'field_school_tid';
$handler->display->display_options['filters']['field_school_term_id_value']['value'] = array(
  'early_childhood' => 'early_childhood',
  'elementary' => 'elementary',
  'intermediate' => 'intermediate',
  'middle' => 'middle',
  'junior' => 'junior',
  'grade_6_12' => 'grade_6_12',
  'high' => 'high',
  'homeschool' => 'homeschool',
  'other' => 'other',
);
$handler->display->display_options['filters']['field_school_term_id_value']['group'] = 1;
$handler->display->display_options['filters']['field_school_term_id_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_school_term_id_value']['expose']['operator_id'] = 'field_school_term_id_value_op';
$handler->display->display_options['filters']['field_school_term_id_value']['expose']['label'] = 'School Type';
$handler->display->display_options['filters']['field_school_term_id_value']['expose']['operator'] = 'field_school_term_id_value_op';
$handler->display->display_options['filters']['field_school_term_id_value']['expose']['identifier'] = 'field_school_term_id_value';
$handler->display->display_options['filters']['field_school_term_id_value']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
  7 => 0,
  8 => 0,
  10 => 0,
  9 => 0,
  4 => 0,
  5 => 0,
  11 => 0,
  6 => 0,
  15 => 0,
  14 => 0,
  13 => 0,
  12 => 0,
);
$handler->display->display_options['filters']['field_school_term_id_value']['expose']['reduce'] = TRUE;

/* Display: Logs - Admin Page */
$handler = $view->new_display('page', 'Logs - Admin Page', 'logs_admin_page');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Logs';
$handler->display->display_options['path'] = 'admin/site/logs2';
$handler->display->display_options['menu']['type'] = 'tab';
$handler->display->display_options['menu']['title'] = 'Logs';
$handler->display->display_options['menu']['weight'] = '21';
$handler->display->display_options['menu']['name'] = 'management';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['menu']['context_only_inline'] = 0;
sgdev’s picture

@Begun, please try the patch I posted in #5 and see if it resolves your issues, or let me know if you are able to identify other problems. Thanks.

tterranigma’s picture

#5 works great. The only minor issue with it is that if you have opened the fieldset for the secondary (ajax) filters but haven't selected any, and then use an ajax primary filter to search, the filedset collapses.

vegansupreme’s picture

#5 works for me. Not using AJAX filters though.

sgdev’s picture

Status: Needs work » Needs review

@terrangima, can you describe to me the use case where this would be needed? The reason for opening the fieldset is to show values if they have been entered. If nothing was entered in the secondary filters, why keep it open and maximize space?

Maybe you're taking it from the point of view that if the user does anything in the site to change a format, the system should keep track of it. This is what's done when using vertical tabs in content types... it keeps track of the last saved "active tab" by storing a value in the database. However that's extra work for not a lot of extra benefit. We should focus first on just trying to get this patch committed, and then can consider add-ons such as that.

I'm moving the issue back to 'needs review' and hopefully @mikeker can look at it again.

sgdev’s picture

Looks like patch #5 no longer applies cleanly to 7.x-3.x-dev since line numbers have shifted. Attached is an updated version for review.

sgdev’s picture

This patch still applies cleanly to the newest 7.x-3.6 release. Would appreciate any feedback or review.

neslee canil pinto’s picture

Status: Needs review » Closed (won't fix)

Hi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Closing this as Closed(wont fix).