I have an exposed filter with exposed operator on an optional text field.
When i click on the "is empty" option, the filter disappears from display; viewing the html source shows :
<div id="edit-field-sgaide-acces-value-wrapper" class="views-exposed-widget views-widget-filter-field_sgaide_acces_value dependent-options" style="display: none">
where I noted the display: none as being the problem.
There is a submit button and when I hit it, the filtering is done (but the filter remains invisible).
There is a reset button and using it reverts to the correct situation, i.e. all filters reset and visible.
I have several views with the same configuration and this happens for all of them.
The problem is the same for the "is not empty" option.
Views is a rich module and I was not able to point on a specific faulty piece of code.
I supposed that the problem came from the usage of term "empty" in the url parameter for exposed operator but I cannot find the reason why (maybe "empty" is a convention for tagging elements that must not be displayed and is wrongly interpreted in this case).
View export :
$view = new view;
$view->name = 'aide_composants_liste';
$view->description = '';
$view->tag = 'SGAIDE Cont';
$view->base_table = 'node';
$view->human_name = 'AIDE Composants liste';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$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['title'] = 'Liste des composants';
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
6 => '6',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filtrer';
$handler->display->display_options['exposed_form']['options']['reset_button'] = TRUE;
$handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Réinitialiser';
$handler->display->display_options['exposed_form']['options']['autosubmit'] = 0;
$handler->display->display_options['exposed_form']['options']['autosubmit_hide'] = 1;
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
'title' => 'title',
'field_sgaide_lignage' => 'field_sgaide_lignage',
'type' => 'type',
'field_sgaide_acces' => 'field_sgaide_acces',
'timestamp' => 'timestamp',
'changed' => 'changed',
'status' => 'status',
'body' => 'body',
'edit_node' => 'edit_node',
'delete_node' => 'delete_node',
);
$handler->display->display_options['style_options']['default'] = 'title';
$handler->display->display_options['style_options']['info'] = array(
'title' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
),
'field_sgaide_lignage' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
),
'type' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
),
'field_sgaide_acces' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
),
'timestamp' => array(
'align' => '',
'separator' => '',
),
'changed' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
),
'status' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
),
'body' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
),
'edit_node' => array(
'align' => '',
'separator' => '',
),
'delete_node' => array(
'align' => '',
'separator' => '',
),
);
$handler->display->display_options['style_options']['override'] = 1;
$handler->display->display_options['style_options']['sticky'] = 1;
$handler->display->display_options['style_options']['empty_table'] = 1;
/* Champ: Contenu: Titre */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['external'] = 0;
$handler->display->display_options['fields']['title']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['title']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['element_label_colon'] = 1;
$handler->display->display_options['fields']['title']['element_default_classes'] = 1;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Champ: Contenu: Lignage */
$handler->display->display_options['fields']['field_sgaide_lignage']['id'] = 'field_sgaide_lignage';
$handler->display->display_options['fields']['field_sgaide_lignage']['table'] = 'field_data_field_sgaide_lignage';
$handler->display->display_options['fields']['field_sgaide_lignage']['field'] = 'field_sgaide_lignage';
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['element_label_colon'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_sgaide_lignage']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_sgaide_lignage']['field_api_classes'] = 0;
/* Champ: Contenu: Type */
$handler->display->display_options['fields']['type']['id'] = 'type';
$handler->display->display_options['fields']['type']['table'] = 'node';
$handler->display->display_options['fields']['type']['field'] = 'type';
$handler->display->display_options['fields']['type']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['type']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['type']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['type']['alter']['external'] = 0;
$handler->display->display_options['fields']['type']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['type']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['type']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['type']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['type']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['type']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['type']['alter']['trim'] = 0;
$handler->display->display_options['fields']['type']['alter']['html'] = 0;
$handler->display->display_options['fields']['type']['element_label_colon'] = 1;
$handler->display->display_options['fields']['type']['element_default_classes'] = 1;
$handler->display->display_options['fields']['type']['hide_empty'] = 0;
$handler->display->display_options['fields']['type']['empty_zero'] = 0;
$handler->display->display_options['fields']['type']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['type']['link_to_node'] = 0;
$handler->display->display_options['fields']['type']['machine_name'] = 0;
/* Champ: Contenu: Code d'accès */
$handler->display->display_options['fields']['field_sgaide_acces']['id'] = 'field_sgaide_acces';
$handler->display->display_options['fields']['field_sgaide_acces']['table'] = 'field_data_field_sgaide_acces';
$handler->display->display_options['fields']['field_sgaide_acces']['field'] = 'field_sgaide_acces';
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_sgaide_acces']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_sgaide_acces']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_sgaide_acces']['field_api_classes'] = 0;
/* Champ: Contenu: Has new content */
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['table'] = 'history';
$handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['label'] = '';
$handler->display->display_options['fields']['timestamp']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['external'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['timestamp']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['timestamp']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['trim'] = 0;
$handler->display->display_options['fields']['timestamp']['alter']['html'] = 0;
$handler->display->display_options['fields']['timestamp']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['timestamp']['element_default_classes'] = 1;
$handler->display->display_options['fields']['timestamp']['hide_empty'] = 0;
$handler->display->display_options['fields']['timestamp']['empty_zero'] = 0;
$handler->display->display_options['fields']['timestamp']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
/* Champ: Contenu: Updated date */
$handler->display->display_options['fields']['changed']['id'] = 'changed';
$handler->display->display_options['fields']['changed']['table'] = 'node';
$handler->display->display_options['fields']['changed']['field'] = 'changed';
$handler->display->display_options['fields']['changed']['label'] = 'Modifié';
$handler->display->display_options['fields']['changed']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['changed']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['changed']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['changed']['alter']['external'] = 0;
$handler->display->display_options['fields']['changed']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['changed']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['changed']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['changed']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['changed']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['changed']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['changed']['alter']['trim'] = 0;
$handler->display->display_options['fields']['changed']['alter']['html'] = 0;
$handler->display->display_options['fields']['changed']['element_label_colon'] = 1;
$handler->display->display_options['fields']['changed']['element_default_classes'] = 1;
$handler->display->display_options['fields']['changed']['hide_empty'] = 0;
$handler->display->display_options['fields']['changed']['empty_zero'] = 0;
$handler->display->display_options['fields']['changed']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['changed']['date_format'] = 'short';
/* Champ: Contenu: Publié */
$handler->display->display_options['fields']['status']['id'] = 'status';
$handler->display->display_options['fields']['status']['table'] = 'node';
$handler->display->display_options['fields']['status']['field'] = 'status';
$handler->display->display_options['fields']['status']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['status']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['status']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['status']['alter']['external'] = 0;
$handler->display->display_options['fields']['status']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['status']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['status']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['status']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['status']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['status']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['status']['alter']['trim'] = 0;
$handler->display->display_options['fields']['status']['alter']['html'] = 0;
$handler->display->display_options['fields']['status']['element_label_colon'] = 1;
$handler->display->display_options['fields']['status']['element_default_classes'] = 1;
$handler->display->display_options['fields']['status']['hide_empty'] = 0;
$handler->display->display_options['fields']['status']['empty_zero'] = 0;
$handler->display->display_options['fields']['status']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['status']['not'] = 0;
/* Champ: Contenu: Corps */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
$handler->display->display_options['fields']['body']['label'] = 'Texte';
$handler->display->display_options['fields']['body']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['body']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['body']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['body']['alter']['external'] = 0;
$handler->display->display_options['fields']['body']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['body']['alter']['trim_whitespace'] = 1;
$handler->display->display_options['fields']['body']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['body']['alter']['max_length'] = '200';
$handler->display->display_options['fields']['body']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['body']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['body']['alter']['strip_tags'] = 1;
$handler->display->display_options['fields']['body']['alter']['trim'] = 1;
$handler->display->display_options['fields']['body']['alter']['html'] = 1;
$handler->display->display_options['fields']['body']['element_label_colon'] = 1;
$handler->display->display_options['fields']['body']['element_default_classes'] = 1;
$handler->display->display_options['fields']['body']['hide_empty'] = 0;
$handler->display->display_options['fields']['body']['empty_zero'] = 0;
$handler->display->display_options['fields']['body']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['body']['settings'] = array(
'trim_length' => '600',
);
$handler->display->display_options['fields']['body']['field_api_classes'] = 0;
/* Champ: Contenu: Edit link */
$handler->display->display_options['fields']['edit_node']['id'] = 'edit_node';
$handler->display->display_options['fields']['edit_node']['table'] = 'node';
$handler->display->display_options['fields']['edit_node']['field'] = 'edit_node';
$handler->display->display_options['fields']['edit_node']['label'] = '';
$handler->display->display_options['fields']['edit_node']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['external'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['edit_node']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['edit_node']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['trim'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['html'] = 0;
$handler->display->display_options['fields']['edit_node']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['edit_node']['element_default_classes'] = 1;
$handler->display->display_options['fields']['edit_node']['hide_empty'] = 0;
$handler->display->display_options['fields']['edit_node']['empty_zero'] = 0;
$handler->display->display_options['fields']['edit_node']['hide_alter_empty'] = 0;
/* Champ: Contenu: Delete link */
$handler->display->display_options['fields']['delete_node']['id'] = 'delete_node';
$handler->display->display_options['fields']['delete_node']['table'] = 'node';
$handler->display->display_options['fields']['delete_node']['field'] = 'delete_node';
$handler->display->display_options['fields']['delete_node']['label'] = '';
$handler->display->display_options['fields']['delete_node']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['external'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['delete_node']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['delete_node']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['trim'] = 0;
$handler->display->display_options['fields']['delete_node']['alter']['html'] = 0;
$handler->display->display_options['fields']['delete_node']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['delete_node']['element_default_classes'] = 1;
$handler->display->display_options['fields']['delete_node']['hide_empty'] = 0;
$handler->display->display_options['fields']['delete_node']['empty_zero'] = 0;
$handler->display->display_options['fields']['delete_node']['hide_alter_empty'] = 0;
/* Sort criterion: Contenu: Titre */
$handler->display->display_options['sorts']['title']['id'] = 'title';
$handler->display->display_options['sorts']['title']['table'] = 'node';
$handler->display->display_options['sorts']['title']['field'] = 'title';
/* Sort criterion: Contenu: Lignage (field_sgaide_lignage) */
$handler->display->display_options['sorts']['field_sgaide_lignage_value']['id'] = 'field_sgaide_lignage_value';
$handler->display->display_options['sorts']['field_sgaide_lignage_value']['table'] = 'field_data_field_sgaide_lignage';
$handler->display->display_options['sorts']['field_sgaide_lignage_value']['field'] = 'field_sgaide_lignage_value';
/* Filter criterion: Contenu: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'sgaide_collecteur' => 'sgaide_collecteur',
'sgaide_composant' => 'sgaide_composant',
);
$handler->display->display_options['filters']['type']['exposed'] = TRUE;
$handler->display->display_options['filters']['type']['expose']['operator_id'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['label'] = 'Type';
$handler->display->display_options['filters']['type']['expose']['use_operator'] = 1;
$handler->display->display_options['filters']['type']['expose']['operator'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['identifier'] = 'type';
$handler->display->display_options['filters']['type']['expose']['remember'] = 1;
$handler->display->display_options['filters']['type']['expose']['multiple'] = 1;
$handler->display->display_options['filters']['type']['expose']['reduce'] = 1;
/* Filter criterion: Contenu: Titre */
$handler->display->display_options['filters']['title']['id'] = 'title';
$handler->display->display_options['filters']['title']['table'] = 'node';
$handler->display->display_options['filters']['title']['field'] = 'title';
$handler->display->display_options['filters']['title']['operator'] = 'contains';
$handler->display->display_options['filters']['title']['exposed'] = TRUE;
$handler->display->display_options['filters']['title']['expose']['operator_id'] = 'title_op';
$handler->display->display_options['filters']['title']['expose']['label'] = 'Titre';
$handler->display->display_options['filters']['title']['expose']['use_operator'] = 1;
$handler->display->display_options['filters']['title']['expose']['operator'] = 'title_op';
$handler->display->display_options['filters']['title']['expose']['identifier'] = 'title';
$handler->display->display_options['filters']['title']['expose']['required'] = 0;
$handler->display->display_options['filters']['title']['expose']['remember'] = 1;
$handler->display->display_options['filters']['title']['expose']['multiple'] = FALSE;
/* Filter criterion: Contenu: Lignage (field_sgaide_lignage) */
$handler->display->display_options['filters']['field_sgaide_lignage_value']['id'] = 'field_sgaide_lignage_value';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['table'] = 'field_data_field_sgaide_lignage';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['field'] = 'field_sgaide_lignage_value';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['operator'] = 'contains';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['operator_id'] = 'field_sgaide_lignage_value_op';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['label'] = 'Lignage';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['use_operator'] = 1;
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['operator'] = 'field_sgaide_lignage_value_op';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['identifier'] = 'field_sgaide_lignage_value';
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['required'] = 0;
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['remember'] = 1;
$handler->display->display_options['filters']['field_sgaide_lignage_value']['expose']['multiple'] = FALSE;
/* Filter criterion: Contenu: Code d'accès (field_sgaide_acces) */
$handler->display->display_options['filters']['field_sgaide_acces_value']['id'] = 'field_sgaide_acces_value';
$handler->display->display_options['filters']['field_sgaide_acces_value']['table'] = 'field_data_field_sgaide_acces';
$handler->display->display_options['filters']['field_sgaide_acces_value']['field'] = 'field_sgaide_acces_value';
$handler->display->display_options['filters']['field_sgaide_acces_value']['operator'] = 'contains';
$handler->display->display_options['filters']['field_sgaide_acces_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['operator_id'] = 'field_sgaide_acces_value_op';
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['label'] = 'Code d\'accès';
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['use_operator'] = 1;
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['operator'] = 'field_sgaide_acces_value_op';
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['identifier'] = 'field_sgaide_acces_value';
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['required'] = 0;
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['remember'] = 1;
$handler->display->display_options['filters']['field_sgaide_acces_value']['expose']['multiple'] = FALSE;
/* Filter criterion: Contenu: Corps (body) */
$handler->display->display_options['filters']['body_value']['id'] = 'body_value';
$handler->display->display_options['filters']['body_value']['table'] = 'field_data_body';
$handler->display->display_options['filters']['body_value']['field'] = 'body_value';
$handler->display->display_options['filters']['body_value']['operator'] = 'contains';
$handler->display->display_options['filters']['body_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['body_value']['expose']['operator_id'] = 'body_value_op';
$handler->display->display_options['filters']['body_value']['expose']['label'] = 'Corps';
$handler->display->display_options['filters']['body_value']['expose']['use_operator'] = 1;
$handler->display->display_options['filters']['body_value']['expose']['operator'] = 'body_value_op';
$handler->display->display_options['filters']['body_value']['expose']['identifier'] = 'body_value';
$handler->display->display_options['filters']['body_value']['expose']['required'] = 0;
$handler->display->display_options['filters']['body_value']['expose']['remember'] = 1;
$handler->display->display_options['filters']['body_value']['expose']['multiple'] = FALSE;
/* Filter criterion: Contenu: Type */
$handler->display->display_options['filters']['type_1']['id'] = 'type_1';
$handler->display->display_options['filters']['type_1']['table'] = 'node';
$handler->display->display_options['filters']['type_1']['field'] = 'type';
$handler->display->display_options['filters']['type_1']['value'] = array(
'sgaide_collecteur' => 'sgaide_collecteur',
'sgaide_composant' => 'sgaide_composant',
);
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'aide-composants-liste';
$handler->display->display_options['menu']['type'] = 'normal';
$handler->display->display_options['menu']['title'] = 'Liste des composants';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['name'] = 'menu-edition';
$translatables['aide_composants_liste'] = array(
t('Master'),
t('Liste des composants'),
t('more'),
t('Filtrer'),
t('Réinitialiser'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('Titre'),
t('Lignage'),
t('Type'),
t('Code d\'accès'),
t('Modifié'),
t('Publié'),
t('Texte'),
t('Corps'),
t('Page'),
);
Comments
Comment #1
rachek commentedI experience the same problem. This bug presents in dev version too (2011-Aug-17).
Comment #2
dawehnerMh this works fine for me. Perhaps it got fixed in the meantime but i doubt this.
It would be cool if you could try to reproduce this with only availible fields/filters, not with special fieldapi filters.
Comment #3
bgentile-1 commentedSorry but what do you mean saying "with only available fields/filters, not with special fieldapi filters" ?
I believe I did not use anything "special".
Comment #4
bgentile-1 commentedI am not familiar with drupal.org usages. Seeing no answer to may last question I have reset the status to "active".
Sorry if I am wrong.
Comment #5
rlmumfordI have this issue with a run of the mill check-box text list field.
Comment #6
dawehnerMh, okay i rephrase it. Try to reproduce the bug with filters + view-type (like content) which is availible from a clean installation of drupal + views.
Comment #7
jkaine commentedI had this happen, but was able to fix it by turning off the "Remember the last selection" checkbox on my filter criteria.
I do believe that this is a bug-- it would be handy to use the "Remember last selection" feature-- but at least there is a short term solution.
If I can help more with examples, screen shots, etc., let me know.
JK
Comment #8
esmerel commentedComment #9
nicholasthompsonThis happens in rc3 too. It seems to be triggered by CTools (using Chrome, you can "break on attribute change" and inspect the stack).
Ctools line 193, there is an
object.css('display', 'none');which seems to be dependant onDrupal.settings.CTools.dependent[id].num <= lenComment #10
nicholasthompsonSee screenshot - looks like ctools is setting the "type" to 'hide'. I dont have time right now to delve into this - but hopefully this points some god-like developer in the right direction (/me looks at dereine ;-) hehe)
Comment #11
merlinofchaos commentedWait, this is totally intentional. If you select "Is empty" then the value has no meaning, so it hides the value. If you move it away from "Is empty" it should bring the filter back, yes?
Unless it hides the operator too, what's the problem here?
Comment #12
jkaine commentedThe problem is that once you've selected the filter item, if there's no value, the entire drop down menu for that field disappears... and without the drop down menu, you can't change the filter setting away from the empty value.
You do have the option of including a reset button, but that seems like a bulky solution.
Comment #13
marcoka commentedfrom a point of usability to will be FORCED to RESET everything to change the filter. that is why this is extremely bad.
Filter: http://www.root.artwaves.de/screensnapr/1332173597-3PWmRX.jpg
select not empty
http://www.root.artwaves.de/screensnapr/1332173623-J0ug1t.jpg
filter is gone: http://www.root.artwaves.de/screensnapr/1332173634-YaOq51.jpg
how do i change the filter now? i am forced to reset ALL filters by clicking RESET.
Comment #14
jordiserra commentedIt hides the operator, that's the problem! Then once you've selected the filter null or not null, if you want to change you have to reset all filters, or reload the page.
Comment #15
rol commentedsame here!
is_empty or is_not_empty makes filter disappear
Comment #16
rol commentedthis behaviour is not present when content type is NUMERIC.
Numeric TYPE-- filter OK
LINK TYPE -- filter KO in some options like is_empty, but seems to work in not exposed operation when filter function is CONTAINS for example
so maybe is only for LINK content type
Comment #17
giorgio79 commentedI am getting this for simple text field filters as well.
Comment #18
rasmusknabe@gmail.com commentedI have the same problem.. If the filter returns no values, in it's default state, not even the operators are shown.. I have an exposed filter set to "Is equal to".
Comment #19
carn1x commentedI'm also getting this problem even though all filters are not set to "Remember the last selection".
It's happening on Text, Term fields, however Date filters on the same View seem to be working fine.
Views 7.x-3.3
Ctools 7.x-1.0
EDIT: Ctools 7.x-1.1 as well.
Comment #20
ygerasimov commentedHere is how to reproduce the problem on the clean installation:
On textfield in this case dependency.js javascript is applied. And it is meant to be hidden when operator values are "Is empty" or "Is not empty". Everything is great on php side but dependency.js hides wrapper block that is calculated as
var object = $('#' + id + '-wrapper');But in the markup of the exposed filters this wrapper also includes operator field itself.
This is why we have this problem.
In attached patch I add id to the first wrapper around widget and rename id of the upper level wrapper.
I am a bit afraid about implications as styles of the sites can be broken because of this.
The other way to fix this is to change ctools dependency.js javascript. For example we can add "dependency_wrapper" property to the Form API level and this will tell javascript specifically what wrapper to hide.
Comment #21
Pls commentedPatch from #20 looks good and fixes the problem. Looks to me like a really elegant fix. Would love to see other testers confirming this patch. Marking RTBC.
Comment #22
dawehnerI'm not sure what to do here, because changing css classes could harm a lot of people compared to the amount
of people which wants to use #dependency for exposed filters, so this seems to be a question of cost-benefit.
I totally agree that from the pure technical point of view the patch is fine.
Comment #23
prossel commentedI'm wondering if the original intent could be to hide the values if one selects an operator which does not need a value (ie: is empty or is not empty).
The problem would be that the whole filter is hidden instead of only the values.
Note that the values should be made visible again when the operator is changed back to one that needs a value.
Comment #24
rolando.alevelbeyond commentedI'm also having this issue.. wanted to create a simple.. if field is empty filter but it disappears on me.. gonna test out the patch..
Comment #25
rolando.alevelbeyond commentedYeah, not sure about the ramifications of applying the patch on the post #20, but it works great..
Comment #26
jhodgdonI am seeing this problem today as well, using the latest DEV views and ... well probably not quite the latest ctools.
The problem is this, succinctly:
- I have a view with an exposed filter with an exposed operator.
- In my case, I am using AJAX mode for filtering, but I don't know if this is necessary to trigger the problem.
- When displaying the view, change the operator to "Is null", and both the value field (which should be hidden) and the drop-down select box for the operator (which shouldn't) are hidden, which means you can no longer see the filter section at all.
The reason is this code in ctools/js/dependent.cs:
coupled with this HTML markup for the operator + value:
So what happens is that when you select "Is null" or "Is not null" as the operator, the CTools code finds the wrapper div, which wraps both the op select and the value input field, and hides that. It should just be hiding the value input field.
The proposed patch on #20 fixes the problem by changing the markup. The second-most div in the above gets ID edit-object-name-op-widget-wrapper instead of edit-object-name-op-wrapper, and the div in the above that wraps the value field, which previously had no ID, now has the ID of "edit-object-name-wrapper".
This fix does work for me... I am not sure what other implications it would have, but the problem is definitely real and the patch fixes it. Of course, it could have CSS implications though.
Comment #27
dawehnerIt's quite hard to decide whether it's possible to commit something which breaks the CSS for people.
In an ideal world people would read the release announcement, though to be realistic, that's not the case.
Couldn't we sort of introduce new wrappers which wrap the existing ones?
Comment #28
jhodgdonI don't think that would work. The ctools JS code takes the ID of the select in question, and puts "-wrapper" on the end, and then hides that. Just adding additional wrappers will not help this. So, the two alternatives are:
a) Make sure that the IDs for the select and the value match what the JS code works off of (current patch)
b) Fix the JS so that instead of hiding the div based on appending "-wrapper" to the ID of the select, there is some way to specify "Hide this other div with this other ID when the select changes to one of these values" (not sure how to do that).
Comment #29
dawehnerWell I fear we just have to grasp the nettle and get it in.
Comment #30
jhodgdonWell, fixing the JS could also be an option. :)
Comment #31
dawehnerI just wanted to apply the patch and it doesn't work anymore :(
Comment #32
jhodgdonYou mean the patch doesn't apply or it applies but doesn't fix the problem any more?
Comment #33
dawehnerYeah applying the patch fails.
Comment #34
topdillon commentedIf mine is a separate issue, please tell me. version 7.x-3.7
In my case I have an exposed operator for the 'Roles' filter. One of the operator options is: "Only has the authenticated user role". In this case, I expect the drop-down with the roles options to disappear, but the wrapper is set to "display: none;"
Comment #35
Shevchuk commentedLook at #477984: CCK field is empty/not empty filter doesn't work when exposed, comment #60 in particular — it has a working patch attached.
Comment #36
jhodgdonDid you test that patch to see if it fixes the issue here?
Comment #37
shaundychkoI had to resort to
in the admin theme CSS to override the inline "display: none;" style inserted by the Views JS. If you look at the html source for the exposed select list you'll see which one gets the inline style, and you then target the id of that div.
I ran into this issue when building a user admin page with Views Bulk Operations and exposed the Role operator. Selecting "User has only authenticated user role" made the widget disappear.
Comment #38
drupalshrek commentedI too had this "disappearing filters" issue.
The problem occurred for me when selecting the filters:
By commenting out the object.css('display', 'none') line in the dependent.js the problem goes away. See patch and below:
What I'm not sure of though, is when this code is actually invoked for other purposes, so this patch may have unintended side effects.
Comment #40
drupalshrek commentedI found out what the nasty side-effect of the above patch would be: date fields with a start and end date display both the start and end date alongside the single date (so I had 6 fields instead of 2: start date dropdown with a start and end date field, and an end date dropdown with a start and end date field). Anyway, now I know more when it is used.
The kludge we came up with to force the "display: none" from getting ignored, was to find the CSS of the fields which were getting hidden, and to add CSS to force them not being hidden:
It's a real kludge, but it works, and it shouldn't have any nasty side effects.
Comment #41
looplog commentedI ran into the same problem but was able to workaround it somewhat using the existing views exposed filter group functionality. Might be useful for others in this situation.
By using two exposed filters of the same type, you can have the first set to "Grouped" with one filter for each of the [Is empty (NULL)] and [Is not empty (NULL)] operators. You can ignore actual value selections for the filters. Give each an appropriate label and make sure optional is unchecked and you will effectively have a dual state operator toggle. You can then add a second exposed filter of the same type to use for selecting items.
When the first filter group is set to the [Is empty (NULL)] filter and the second filter set to Any, the view will only show NULL results. With the first filter is set to the [Is not empty (NULL)] filter, you will get the results from the second filter.
Comment #42
joachim commentedSurely this is a major. It breaks part of the Views UI quite badly.
Comment #43
kopeboyAny news?
Is a small fix no?
Comment #44
jayelless commentedI have prepared a patch that causes the css "display: none;" to be applied to the child "views-widget" element, which is the one that requires hiding, rather then the entire filter object, when either of the options "Is empty" or "Is not empty" is selected from the drop down operator choices.
Please review, and apply if OK.
Comment #45
jayelless commentedCorrection. The previous patch did not restore the filter selection options when the operator was returned to a value requiring a selected option ("Is one of" ...) from either of the "empty" options. This later patch corrects that fault.
Comment #46
citlacom commentedI have same problem as @jlscott so tested him patch #45 that works for "is one of" / "is not one of" exposed filters but brokes the UI of range exposed filters "is between" with exposed operator leaving the single value textfield displayed when the between operator is selected as a result three textfields are display when only two are expected. I tried different approach that is working for my exposed filters use case.
Comment #48
mbnsorg commentedcitlacom, for ctools 7.x-1.7, patch #46 code is broken. Might be why it failed test. Patch #46 does not handle a close-paren as spec'd in original version. Also, can confirm the same issue with #45 as you mention.
#46 works better, but is still not quite right. The "is empty" query will only work if a previous search was done on that field. But at least that is a workaround, so good enough for now.
Correction: I had first applied this patch #80 https://www.drupal.org/node/477984#comment-8861095 but forgot to un-apply it for the #46 patch test. Just rolled #80 back and #46 works as desired. Thx for posting it.
Comment #51
fonant commentedProblem with #46 is that the patch needs "-p5" and not the standard "-p1" that Drupal specifies for patches.
Comment #52
paul rowell commentedPatch in #46 worked for me too. ctools 7.x-1.7
edit: meant 46, not 45. Though had to apply manually
Comment #53
Aambro commentedPatch in #46 worked for me too! Thanks!
Comment #54
wickwood commentedI manually applied patch #46 to commit SHA ID# 1aa931b5caadce86e226ba06bdcdd3463cf52d67 from 3/11/2015 and then merged in changes from 7.x-1.7.
Everything works as expected as far as I can tell.
Thanks for the new patches. Been using patch from #20 for years now and it makes more sense to patch ctools instead of views to me if this is where the problem originates.
All the Best,
Steve
Comment #55
cutesquirrel commentedHi,
the #46 patch works great with ctools-1.9.
Cheers
Comment #57
milesw commentedPatch #46 applies cleanly to CTools 1.9 and fixes the original issue.
Comment #58
andeersg commentedI'm not sure if I experience the same issue, but it's the same file and problem. Only it happens in Panels form.
When I edit a panel pane the form loads with the checkbox to override title, but no matter what state it's in the textfield and tag select does not appear.
This happens with CTools 7.x-1.9. Again, apologies if this is in the wrong place.
Comment #59
hanoiiJust a re-roll of #46 properly formatted, should apply to other versions as well.
Comment #60
deetergp commentedI have tested the patch in #59 and have found it to fix the issue & have included it in the make file for our distro.
Comment #61
japerryI'd love to get this committed, however I'm worried the JS might have some unintended consequences. Hopefully damienmckenna can chime in on this one, specifically #59.
The other patches to the markup and css I don't believe are the correct approaches. The big worry here is breaking other functionality.
Comment #62
jessehsI'm wondering why this might surface in my integration environment and not my development environment.
I created a view locally, and everything was fine. Then pushed it up to an integration server and the exposed filter was "display:none".
I tested the patch in #59, and it worked -- integration environment is fixed. I'm just curious why that would be different. I'm running php 5.6 in dev and 5.5 in integration... can you think of any other environment variables that I should look into?
Thanks!
Comment #63
rlmumford#59 work for me!
Comment #64
marcvangendThe patch from #59 works for me. Here is a new patch with two minor improvements:
- Correctly declare the object variable,
var object = ...instead ofobject = ...- Do not run the same jQuery selector twice, for better performance.
I'm keeping this issue RTBC because the solution itself didn't change.
Comment #65
Anonymous (not verified) commented#64 Works for me as well. Thanks.
Comment #66
japerry#64 looks good. Committed.
Comment #69
mustanggb commentedThis caused a pretty monumental regression, see #2791769: REGRESSION: CTools dependent broken on radio buttons and select lists.