Hi,

I try to show a little message on top of one of my views which specify the number of results found by the view.
I used to put this snippet in the views-view.tpl.php file

<?php echo format_plural(max(0, $view->total_rows), '1 <em>result</em>', '@count <em>results</em>'); ?>

It worked well until I patched View to the last dev version. Now, total_rows is null even if the view show something.

I hope that somebody will have a idea to patch this.
Thanks

Here is an export of my view :

$view = new view;
$view->name = 'clone_de_annonces';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Clone de Annonces';
$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_more_text'] = 'plus';
$handler->display->display_options['access']['type'] = 'none';
$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'] = 'better_exposed_filters';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Rechercher';
$handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Réinitialiser';
$handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Trié par';
$handler->display->display_options['exposed_form']['options']['autosubmit'] = 0;
$handler->display->display_options['exposed_form']['options']['autosubmit_hide'] = 1;
$handler->display->display_options['exposed_form']['options']['bef'] = array(
  'sort' => array(
    'bef_format' => 'default',
    'combine' => 0,
    'reset' => 0,
    'reset_label' => '',
  ),
  'keys' => array(
    'more_options' => array(
      'bef_filter_description' => 'Ex : Chaises, barrières...',
    ),
  ),
  'term_node_tid_depth' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'bef_select_all_none' => 0,
      'bef_collapsible' => 0,
      'bef_filter_description' => '',
    ),
  ),
  'field_department_value' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'bef_select_all_none' => 0,
      'bef_collapsible' => 0,
      'bef_filter_description' => '',
    ),
  ),
);
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'list';
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['hide_empty'] = 0;
$handler->display->display_options['row_options']['default_field_elements'] = 1;
/* Comportement en l'absence de résultats: Global : Zone de texte */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['label'] = 'Empty';
$handler->display->display_options['empty']['area']['empty'] = FALSE;
$handler->display->display_options['empty']['area']['content'] = 'Aucune annonce dans cette catégorie';
$handler->display->display_options['empty']['area']['format'] = 'plain_text';
$handler->display->display_options['empty']['area']['tokenize'] = 0;
/* Relation: Contenu : Catégorie (field_category) */
$handler->display->display_options['relationships']['field_category_tid']['id'] = 'field_category_tid';
$handler->display->display_options['relationships']['field_category_tid']['table'] = 'field_data_field_category';
$handler->display->display_options['relationships']['field_category_tid']['field'] = 'field_category_tid';
$handler->display->display_options['relationships']['field_category_tid']['label'] = 'category';
$handler->display->display_options['relationships']['field_category_tid']['required'] = 1;
/* Relation: Terme de taxonomie : Terme parent */
$handler->display->display_options['relationships']['parent']['id'] = 'parent';
$handler->display->display_options['relationships']['parent']['table'] = 'taxonomy_term_hierarchy';
$handler->display->display_options['relationships']['parent']['field'] = 'parent';
$handler->display->display_options['relationships']['parent']['relationship'] = 'field_category_tid';
$handler->display->display_options['relationships']['parent']['label'] = 'category parent';
$handler->display->display_options['relationships']['parent']['required'] = 0;
/* Relation: Contenu : Département (field_department) */
$handler->display->display_options['relationships']['field_department_tid']['id'] = 'field_department_tid';
$handler->display->display_options['relationships']['field_department_tid']['table'] = 'field_data_field_department';
$handler->display->display_options['relationships']['field_department_tid']['field'] = 'field_department_tid';
$handler->display->display_options['relationships']['field_department_tid']['label'] = 'department';
$handler->display->display_options['relationships']['field_department_tid']['required'] = 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']['label'] = '';
$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_type'] = '0';
$handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
$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'] = 0;
/* Champ: Contenu : Body */
$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'] = '';
$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'] = 0;
$handler->display->display_options['fields']['body']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['body']['alter']['max_length'] = '150';
$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'] = 0;
$handler->display->display_options['fields']['body']['element_type'] = '0';
$handler->display->display_options['fields']['body']['element_label_colon'] = FALSE;
$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' => '150',
);
$handler->display->display_options['fields']['body']['field_api_classes'] = 0;
/* Champ: Contenu : Photo */
$handler->display->display_options['fields']['field_picture']['id'] = 'field_picture';
$handler->display->display_options['fields']['field_picture']['table'] = 'field_data_field_picture';
$handler->display->display_options['fields']['field_picture']['field'] = 'field_picture';
$handler->display->display_options['fields']['field_picture']['label'] = '';
$handler->display->display_options['fields']['field_picture']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_picture']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_picture']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_picture']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_picture']['element_type'] = '0';
$handler->display->display_options['fields']['field_picture']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_picture']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_picture']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_picture']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_picture']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_picture']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_picture']['settings'] = array(
  'image_style' => 'list',
  'image_link' => '',
);
$handler->display->display_options['fields']['field_picture']['group_rows'] = 1;
$handler->display->display_options['fields']['field_picture']['delta_limit'] = '1';
$handler->display->display_options['fields']['field_picture']['delta_offset'] = '0';
$handler->display->display_options['fields']['field_picture']['delta_reversed'] = 0;
$handler->display->display_options['fields']['field_picture']['field_api_classes'] = 0;
/* Champ: Terme de taxonomie : Numéro */
$handler->display->display_options['fields']['field_dpt_number']['id'] = 'field_dpt_number';
$handler->display->display_options['fields']['field_dpt_number']['table'] = 'field_data_field_dpt_number';
$handler->display->display_options['fields']['field_dpt_number']['field'] = 'field_dpt_number';
$handler->display->display_options['fields']['field_dpt_number']['relationship'] = 'field_department_tid';
$handler->display->display_options['fields']['field_dpt_number']['label'] = '';
$handler->display->display_options['fields']['field_dpt_number']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_dpt_number']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_dpt_number']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['element_type'] = '0';
$handler->display->display_options['fields']['field_dpt_number']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_dpt_number']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_dpt_number']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_dpt_number']['settings'] = array(
  'thousand_separator' => '',
  'prefix_suffix' => 0,
);
$handler->display->display_options['fields']['field_dpt_number']['field_api_classes'] = 0;
/* Champ: Contenu : Type */
$handler->display->display_options['fields']['field_type']['id'] = 'field_type';
$handler->display->display_options['fields']['field_type']['table'] = 'field_data_field_type';
$handler->display->display_options['fields']['field_type']['field'] = 'field_type';
$handler->display->display_options['fields']['field_type']['label'] = '';
$handler->display->display_options['fields']['field_type']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_type']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_type']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_type']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_type']['element_type'] = '0';
$handler->display->display_options['fields']['field_type']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_type']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_type']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_type']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_type']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_type']['field_api_classes'] = 0;
/* Champ: Terme de taxonomie : Nom */
$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']['relationship'] = 'parent';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['name']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['name']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['name']['alter']['external'] = 0;
$handler->display->display_options['fields']['name']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['name']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['name']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim'] = 0;
$handler->display->display_options['fields']['name']['alter']['html'] = 0;
$handler->display->display_options['fields']['name']['element_type'] = '0';
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['name']['element_default_classes'] = 1;
$handler->display->display_options['fields']['name']['hide_empty'] = 1;
$handler->display->display_options['fields']['name']['empty_zero'] = 0;
$handler->display->display_options['fields']['name']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['name']['link_to_taxonomy'] = 1;
/* Champ: Contenu : Catégorie */
$handler->display->display_options['fields']['field_category']['id'] = 'field_category';
$handler->display->display_options['fields']['field_category']['table'] = 'field_data_field_category';
$handler->display->display_options['fields']['field_category']['field'] = 'field_category';
$handler->display->display_options['fields']['field_category']['label'] = '';
$handler->display->display_options['fields']['field_category']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_category']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_category']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_category']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_category']['element_type'] = '0';
$handler->display->display_options['fields']['field_category']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_category']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_category']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_category']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_category']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_category']['field_api_classes'] = 0;
/* Champ: Contenu : Prix */
$handler->display->display_options['fields']['field_price']['id'] = 'field_price';
$handler->display->display_options['fields']['field_price']['table'] = 'field_data_field_price';
$handler->display->display_options['fields']['field_price']['field'] = 'field_price';
$handler->display->display_options['fields']['field_price']['label'] = '';
$handler->display->display_options['fields']['field_price']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_price']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_price']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_price']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_price']['element_type'] = '0';
$handler->display->display_options['fields']['field_price']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_price']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_price']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_price']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_price']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_price']['settings'] = array(
  'thousand_separator' => ' ',
  'decimal_separator' => '.',
  'scale' => '2',
  'prefix_suffix' => 1,
);
$handler->display->display_options['fields']['field_price']['field_api_classes'] = 0;
/* Champ: Contenu : Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['label'] = '';
$handler->display->display_options['fields']['nid']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['nid']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['nid']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['nid']['alter']['external'] = 0;
$handler->display->display_options['fields']['nid']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['nid']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['nid']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['nid']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['nid']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['nid']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['nid']['alter']['trim'] = 0;
$handler->display->display_options['fields']['nid']['alter']['html'] = 0;
$handler->display->display_options['fields']['nid']['element_type'] = '0';
$handler->display->display_options['fields']['nid']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['nid']['element_default_classes'] = 1;
$handler->display->display_options['fields']['nid']['hide_empty'] = 0;
$handler->display->display_options['fields']['nid']['empty_zero'] = 0;
$handler->display->display_options['fields']['nid']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['nid']['link_to_node'] = 0;
/* Champ: Contenu : Département */
$handler->display->display_options['fields']['field_department']['id'] = 'field_department';
$handler->display->display_options['fields']['field_department']['table'] = 'field_data_field_department';
$handler->display->display_options['fields']['field_department']['field'] = 'field_department';
$handler->display->display_options['fields']['field_department']['label'] = '';
$handler->display->display_options['fields']['field_department']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_department']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_department']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_department']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_department']['element_type'] = '0';
$handler->display->display_options['fields']['field_department']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_department']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_department']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_department']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_department']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_department']['type'] = 'taxonomy_term_reference_plain';
$handler->display->display_options['fields']['field_department']['field_api_classes'] = 0;
/* Champ: Terme de taxonomie : Numéro */
$handler->display->display_options['fields']['field_dpt_number_1']['id'] = 'field_dpt_number_1';
$handler->display->display_options['fields']['field_dpt_number_1']['table'] = 'field_data_field_dpt_number';
$handler->display->display_options['fields']['field_dpt_number_1']['field'] = 'field_dpt_number';
$handler->display->display_options['fields']['field_dpt_number_1']['relationship'] = 'field_department_tid';
$handler->display->display_options['fields']['field_dpt_number_1']['label'] = '';
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['element_type'] = '0';
$handler->display->display_options['fields']['field_dpt_number_1']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_dpt_number_1']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_dpt_number_1']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['field_dpt_number_1']['settings'] = array(
  'thousand_separator' => '',
  'prefix_suffix' => 0,
);
$handler->display->display_options['fields']['field_dpt_number_1']['field_api_classes'] = 0;
/* Critère de tri: Contenu : Épinglé (en haut des listes) */
$handler->display->display_options['sorts']['sticky']['id'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['table'] = 'node';
$handler->display->display_options['sorts']['sticky']['field'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['order'] = 'DESC';
/* Critère de tri: Contenu : Date de publication */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['exposed'] = TRUE;
$handler->display->display_options['sorts']['created']['expose']['label'] = 'Date';
/* Critère de tri: Contenu : Prix (field_price) */
$handler->display->display_options['sorts']['field_price_value']['id'] = 'field_price_value';
$handler->display->display_options['sorts']['field_price_value']['table'] = 'field_data_field_price';
$handler->display->display_options['sorts']['field_price_value']['field'] = 'field_price_value';
$handler->display->display_options['sorts']['field_price_value']['exposed'] = TRUE;
$handler->display->display_options['sorts']['field_price_value']['expose']['label'] = 'Prix';
/* Critère de tri: Contenu : Type (field_type) */
$handler->display->display_options['sorts']['field_type_value']['id'] = 'field_type_value';
$handler->display->display_options['sorts']['field_type_value']['table'] = 'field_data_field_type';
$handler->display->display_options['sorts']['field_type_value']['field'] = 'field_type_value';
$handler->display->display_options['sorts']['field_type_value']['exposed'] = TRUE;
$handler->display->display_options['sorts']['field_type_value']['expose']['label'] = 'Type';
/* Filtre contextuel: Contenu : Possède l'identifiant de terme de taxonomie (avec profondeur) */
$handler->display->display_options['arguments']['term_node_tid_depth']['id'] = 'term_node_tid_depth';
$handler->display->display_options['arguments']['term_node_tid_depth']['table'] = 'node';
$handler->display->display_options['arguments']['term_node_tid_depth']['field'] = 'term_node_tid_depth';
$handler->display->display_options['arguments']['term_node_tid_depth']['title_enable'] = 1;
$handler->display->display_options['arguments']['term_node_tid_depth']['title'] = '%1';
$handler->display->display_options['arguments']['term_node_tid_depth']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['term_node_tid_depth']['default_argument_skip_url'] = 0;
$handler->display->display_options['arguments']['term_node_tid_depth']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['term_node_tid_depth']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['term_node_tid_depth']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['term_node_tid_depth']['depth'] = '2';
$handler->display->display_options['arguments']['term_node_tid_depth']['break_phrase'] = 0;
$handler->display->display_options['arguments']['term_node_tid_depth']['set_breadcrumb'] = 0;
$handler->display->display_options['arguments']['term_node_tid_depth']['use_taxonomy_term_path'] = 0;
/* Critère de filtrage: Contenu : Publié */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Critère de filtrage: 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(
  'annonce' => 'annonce',
);
/* Critère de filtrage: Contenu : État (field_state) */
$handler->display->display_options['filters']['field_state_value']['id'] = 'field_state_value';
$handler->display->display_options['filters']['field_state_value']['table'] = 'field_data_field_state';
$handler->display->display_options['filters']['field_state_value']['field'] = 'field_state_value';
$handler->display->display_options['filters']['field_state_value']['value'] = array(
  1 => '1',
);

/* Display: Recherche */
$handler = $view->new_display('page', 'Recherche', 'search');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Résultats de la recherche';
$handler->display->display_options['exposed_block'] = TRUE;
$handler->display->display_options['defaults']['empty'] = FALSE;
/* Comportement en l'absence de résultats: Global : Zone de texte */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['label'] = 'Empty';
$handler->display->display_options['empty']['area']['empty'] = FALSE;
$handler->display->display_options['empty']['area']['content'] = 'La recherche n\'a donné aucun résultat';
$handler->display->display_options['empty']['area']['format'] = 'plain_text';
$handler->display->display_options['empty']['area']['tokenize'] = 0;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Critère de filtrage: Contenu : Publié */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Critère de filtrage: 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(
  'annonce' => 'annonce',
);
$handler->display->display_options['filters']['type']['group'] = 0;
/* Critère de filtrage: Contenu : État (field_state) */
$handler->display->display_options['filters']['field_state_value']['id'] = 'field_state_value';
$handler->display->display_options['filters']['field_state_value']['table'] = 'field_data_field_state';
$handler->display->display_options['filters']['field_state_value']['field'] = 'field_state_value';
$handler->display->display_options['filters']['field_state_value']['value'] = array(
  1 => '1',
);
$handler->display->display_options['filters']['field_state_value']['group'] = 0;
/* Critère de filtrage: Recherche : Termes de recherche */
$handler->display->display_options['filters']['keys']['id'] = 'keys';
$handler->display->display_options['filters']['keys']['table'] = 'search_index';
$handler->display->display_options['filters']['keys']['field'] = 'keys';
$handler->display->display_options['filters']['keys']['group'] = 0;
$handler->display->display_options['filters']['keys']['exposed'] = TRUE;
$handler->display->display_options['filters']['keys']['expose']['operator_id'] = 'keys_op';
$handler->display->display_options['filters']['keys']['expose']['label'] = 'Quoi ?';
$handler->display->display_options['filters']['keys']['expose']['operator'] = 'keys_op';
$handler->display->display_options['filters']['keys']['expose']['identifier'] = 'keys';
$handler->display->display_options['filters']['keys']['expose']['remember'] = 1;
$handler->display->display_options['filters']['keys']['expose']['multiple'] = FALSE;
/* Critère de filtrage: Contenu : Possède les termes de taxonomie (avec profondeur) */
$handler->display->display_options['filters']['term_node_tid_depth']['id'] = 'term_node_tid_depth';
$handler->display->display_options['filters']['term_node_tid_depth']['table'] = 'node';
$handler->display->display_options['filters']['term_node_tid_depth']['field'] = 'term_node_tid_depth';
$handler->display->display_options['filters']['term_node_tid_depth']['group'] = 0;
$handler->display->display_options['filters']['term_node_tid_depth']['exposed'] = TRUE;
$handler->display->display_options['filters']['term_node_tid_depth']['expose']['operator_id'] = 'term_node_tid_depth_op';
$handler->display->display_options['filters']['term_node_tid_depth']['expose']['label'] = 'Dans';
$handler->display->display_options['filters']['term_node_tid_depth']['expose']['operator'] = 'term_node_tid_depth_op';
$handler->display->display_options['filters']['term_node_tid_depth']['expose']['identifier'] = 'category';
$handler->display->display_options['filters']['term_node_tid_depth']['expose']['reduce'] = 0;
$handler->display->display_options['filters']['term_node_tid_depth']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['term_node_tid_depth']['type'] = 'select';
$handler->display->display_options['filters']['term_node_tid_depth']['vocabulary'] = 'categories';
$handler->display->display_options['filters']['term_node_tid_depth']['hierarchy'] = 1;
$handler->display->display_options['filters']['term_node_tid_depth']['error_message'] = 1;
$handler->display->display_options['filters']['term_node_tid_depth']['depth'] = '2';
/* Critère de filtrage: Contenu : Possède les termes de taxonomie (avec profondeur) */
$handler->display->display_options['filters']['term_node_tid_depth_1']['id'] = 'term_node_tid_depth_1';
$handler->display->display_options['filters']['term_node_tid_depth_1']['table'] = 'node';
$handler->display->display_options['filters']['term_node_tid_depth_1']['field'] = 'term_node_tid_depth';
$handler->display->display_options['filters']['term_node_tid_depth_1']['exposed'] = TRUE;
$handler->display->display_options['filters']['term_node_tid_depth_1']['expose']['operator_id'] = 'term_node_tid_depth_1_op';
$handler->display->display_options['filters']['term_node_tid_depth_1']['expose']['label'] = 'Où ?';
$handler->display->display_options['filters']['term_node_tid_depth_1']['expose']['operator'] = 'term_node_tid_depth_1_op';
$handler->display->display_options['filters']['term_node_tid_depth_1']['expose']['identifier'] = 'department';
$handler->display->display_options['filters']['term_node_tid_depth_1']['expose']['reduce'] = 0;
$handler->display->display_options['filters']['term_node_tid_depth_1']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['term_node_tid_depth_1']['type'] = 'select';
$handler->display->display_options['filters']['term_node_tid_depth_1']['vocabulary'] = 'departements';
$handler->display->display_options['filters']['term_node_tid_depth_1']['hierarchy'] = 1;
$handler->display->display_options['filters']['term_node_tid_depth_1']['error_message'] = 1;
$handler->display->display_options['filters']['term_node_tid_depth_1']['depth'] = '1';
$handler->display->display_options['path'] = 'annonces/recherche';
$translatables['clone_de_annonces'] = array(
  t('Master'),
  t('plus'),
  t('Rechercher'),
  t('Réinitialiser'),
  t('Trié par'),
  t('Asc'),
  t('Desc'),
  t('Empty'),
  t('Aucune annonce dans cette catégorie'),
  t('category'),
  t('category parent'),
  t('department'),
  t('Date'),
  t('Prix'),
  t('Type'),
  t('Tous / Toutes'),
  t('%1'),
  t('Recherche'),
  t('Résultats de la recherche'),
  t('La recherche n\'a donné aucun résultat'),
  t('Quoi ?'),
  t('Dans'),
  t('Où ?'),
);

Comments

Anonymous’s picture

Same issue here. $view->total_rows is empty. I'm using 7.x-3.0-rc1 though.

duaelfr’s picture

StatusFileSize
new525 bytes

First, fix the pagers with : http://drupal.org/node/1090098#comment-5104580

Then, for views not using a pager, use the attached patch.

dawehner’s picture

Mh this is a good question, should this be counted like this, because total_rows is actually another information.
If you want to have the total_items you can set a flag with $view->get_total_rows = TRUE; else you can do a count($view->result) for your own.

But sure i'm open for discussion whether it makes sense to calculate the "total rows" like this.

duaelfr’s picture

I think that the cost of these 3 lines of code is really insignificant for the entire module and it allows to deal with this data in a consistent way regardless of a pager configuration.
Moreover, this allow themers to access this information without having to write a custom module to enable get_total_rows.

dawehner’s picture

But well if you do this it will contain a variable which is not expected, as it's not the total row count.

duaelfr’s picture

I don't understand or I may be mistaken somewhere.

If there is no pager set for the view, all the results will be stored in the view->result array so using count on it will retreive the total row count.

In which case this count would not be exact ?

dawehner’s picture

Well total_rows should store the count of ALL rows not only them in $view->result.

duaelfr’s picture

Is it possible, in the case where there is NO PAGER set on the view, that the $view->result variable does not contain ALL the rows ? If it is, could you give me an example ? Thank you

dawehner’s picture

Yes it's. You can choose to only display a certain amount of items, but you still have more items available in the theory. This does not run the count query.

duaelfr’s picture

StatusFileSize
new542 bytes

I thought that the "Display a specified number of items" option was a kind of pager.
So this is the limit case in which it is complicated to get the total_rows information.

The following code seems to do the job

$view->total_rows = $count_query->execute()->fetchField();

instead of the simple "count"

It makes an additional sql request but I do not see any other simple alternative.
With more complexity we could add to the views advanced options the ability to disable total_rows calculous but I do not know if it would be very usefull.

dawehner’s picture

Okay i will explain the whole pager thing.

There are three cases by default:

  • You want to have a pager => You have to run a pager query, so you have the information of the total rows
  • You want to display just a certain amount of items, so that you don't need the pager and especially you want to avoid the count query. But if you want to have the correct amount of items set $view->get_total_rows and you will get your information as well.
  • The third case is that you want to display all items. There you also don't need a pager and so no count query

Your patch introduces the count query for case 2 and 3, which is somehow bad :)

sigent’s picture

// views 6.3 rc2

setting $view->get_total_rows (no pager) populates only $view->query->pager->total_items but never $view->total_rows. the last remains null.

broncomania’s picture

I ran into the same problem. I try to develop the datatables ajax backend and I need to get the total amount of all available results even if I display only paged 100 results, but all my attempts fail in d6.3 rc2.

I would like to get the counted results of all available results if I set the $view->get_total_rows = TRUE even if I display it in 100th steps.

Is this possible or do I have to patch something to make this working. At the moment with this setting I always get $view->total_rows = NULL. So I think this is buggy isn't it?

broncomania’s picture

Wouldn't it be easier to add $view->get_total_rows ? The other patches here didn't work for me.

 if ($this->pager->use_pager() || $view->get_total_rows ) {
    $view->total_rows = $this->pager->get_total_items();
 } 
bartezz’s picture

I'm having similar issues as #13, it would be nice to have the total number of rows available even when one is not using a pager in case of AJAX implementations. For now I will enable the pager but just theming it out of the view...

Cheers

merlinofchaos’s picture

Category: bug » support
Status: Active » Closed (works as designed)

For performance reasons, when not using a pager total_rows is not filled in. If you know you'll be needing it, you can set $view->get_total_rows = TRUE to always do this. dereine has already said this.

I find it incredibly frustrating that a lot of people are complaining that this information isn't always available and are trying to patch it in. There are valid reasons why you should NOT request that data if you don't want it. You want to add potentially significant performance hits to every site that uses views, always, so that you can avoid setting a flag? Please try to understand that there are hundreds of thousands of installations of this software.

This is not a bug, and this is by design. On your site, you can in a custom module do this:

function MYMODULE_views_pre_execute($view) {
  if ($view->name == 'name_of_view_I_need_this_information_for') {
    $view->get_total_rows = TRUE;
  }

No code hacks or silly patches to slow down everyone else's site are required.

bartezz’s picture

Appologies! I did miss the part in dereine's #3 comment where she pointed to a solution. Thanx for repeating the issue.
I understand what you're saying performance, point taken.

Cheers

jurgenhaas’s picture

Perfectly reasonable, thanks for the explanation. However, instead of having to write custom code wouldn't it be more convenient if there was a flag in the views UI to allow changing that setting interactively?

merlinofchaos’s picture

Typically one only needs the value with custom code? I don't think the UI can utilize the value. Am I wrong on this?

jurgenhaas’s picture

Well, I came across the situation quite regularely where a customer asked be to include the total number of rows it the header or footer of a view and so far I had to go into custom code to achieve that. Still possible but not quite as convienient as a UI solution could be.

duaelfr’s picture

I agree with jurgenhaas.
As a developper I have no problem building a tiny module to acheive this. However, a lot of site builders would like to see a "Force total row count" option in Views UI and just have to echo this value in their template.

mstrelan’s picture

Typically one only needs the value with custom code? I don't think the UI can utilize the value. Am I wrong on this?

Yes, $view->total_rows is used by views. See views_handler_area_result.inc in the render() function.
$total = $this->view->total_rows;

To use the default result summary that is packaged with views you cannot use "Display all items".

Even if I do set $view->get_total_rows the result summary still doesn't work. Can someone explain what's going on with this code in views_plugin_query_default.inc function execute()

        if ($this->pager->use_count_query() || !empty($view->get_total_rows)) {
          $this->pager->execute_count_query($count_query);
        }

But then later when total_rows is set it doesn't check for use_count_query or get_total_rows

        if ($this->pager->use_pager()) {
          $view->total_rows = $this->pager->get_total_items();
        }

Shouldn't the latter be as below?

        if ($this->pager->use_count_query() || !empty($view->get_total_rows)) {
          $view->total_rows = $this->pager->get_total_items();
        }

Unless there is something missing this seems to make more sense to me. Not rolling a patch right now, just btw.

DanzI-1’s picture

I agree with mstrelan,

if ($this->pager->use_count_query() || !empty($view->get_total_rows)) {
          $view->total_rows = $this->pager->get_total_items();
        }

should be there

DanzI-1’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new560 bytes

here is the patch for that

tim.plunkett’s picture

Category: support » bug
dawehner’s picture

This looks totally reasonable, though it would be great to have some tests, to be sure it will not be broken sometime in the future.

This shouldn't be to hard, as it's setting this variable, and check whether the count is set.

duaelfr’s picture

I think it would be interesting to give the control on this variable in the UI by adding an entry in the "Advanced" section, wouldn't it ?

dkinzer’s picture

Status: Needs review » Needs work

I'm in agreement with @dawehner this needs a test. I'm changing this needs work. I'm working on adding a test:

[13:18] dkinzer: that's about pagers so i guess it should be in tests/views_pager.test
[13:18] dkinzer: maybe a new test method for testCountQuery could be created

dkinzer’s picture

Status: Needs work » Needs review
StatusFileSize
new1.41 KB

Resubmitting same patch as #24 plus added SimpleTest.

dkinzer’s picture

Forgot to apply the assert message.

tim.plunkett’s picture

StatusFileSize
new1.35 KB
new825 bytes

Cleaned up the test a little, and uploading the patch split up to prove the test does something.

tim.plunkett’s picture

Assigned: Unassigned » dawehner

Assigning to dawehner for review.

dawehner’s picture

Status: Needs review » Fixed

Awesome, thanks for the test especially, this really helps to not run into future regressions!

Committed to 7.x-3.x and 8.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

catch’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Closed (fixed) » Needs review
StatusFileSize
new583 bytes

Applies to 6.x-3.x as well.

dawehner’s picture

Status: Needs review » Fixed

And I was sure I have seen DualFR previously in the issue queues.

Committed to 6.x-3.x and pushed
Thank you for posting this to 6.x-3.x as well

  • dawehner committed c9efb36 on 6.x-3.x authored by catch
    Issue #1306196 by DuaelFr, dkinzer, tim.plunkett, DanzI, catch: $view->...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.