Hi,

Thanks a lot for this module I love :-)

I want to integrate the results with views: I do have good results from Extract or Teaser but only the no result page with my view.

This is quite critical for me today :-(

Here is the code of the view:

  $view = new stdClass();
  $view->name = 'liste_facette';
  $view->description = 'Recherche à facettes';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'list';
  $view->url = '';
  $view->use_pager = FALSE;
  $view->nodes_per_page = '0';
  $view->sort = array (
  );
  $view->argument = array (
    array (
      'type' => 'faceted_search_results',
      'argdefault' => '1',
      'title' => '',
      'options' => 'ASC',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'term_image',
      'field' => 'tid',
      'label' => '',
      'handler' => 'views_handler_image_path',
    ),
  );
  $view->filter = array (
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node, term_image);
  $views[$view->name] = $view;

Is it a bug? Or could you tell me where I did wrong?

Thanks,

Alexandre

Comments

David Lesieur’s picture

Not sure why... Have you tried removing the fields and selecting a teaser view, just to see if that changes anything?

sashainparis’s picture

Oui/Yes/Ken/Da/Si :-(

Same thing.
Help welcome

Alexandre

David Lesieur’s picture

Title: Faceted view give no results » Division by zero in pager.inc when Nodes per Page is 0

Just tested your view and found the bug... Until it gets fixed, you'll have to enter a Nodes per Page value greater than zero in your view.

sashainparis’s picture

Hi,

Thank you for this but it is still not working... Any clue concerning possible module compatibility issue?

Alexandre

sashainparis’s picture

Version: 5.x-1.0-beta2 » 5.x-1.0-beta3

Well... I updated to Beta-3 and the View to take your approach into account.
Still not working :-(

Here is the new code from the View

  $view = new stdClass();
  $view->name = 'liste_facette';
  $view->description = 'Recherche à facettes';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'teaser';
  $view->url = '';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '5';
  $view->sort = array (
  );
  $view->argument = array (
    array (
      'type' => 'faceted_search_results',
      'argdefault' => '2',
      'title' => '',
      'options' => 'ASC',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
  );
  $view->filter = array (
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node);
  $views[$view->name] = $view;

Thanks by advance.

Alexandre

David Lesieur’s picture

I have imported your updated view on my test site and it worked flawlessly with Faceted Search...

I guess it is possible that other modules could interfere... You might want to look for modules that control node access, or any module that rewrites queries (through hook_db_rewrite_sql), and try disabling them.

EvanDonovan’s picture

I think that my issue http://drupal.org/node/254069 may be a duplicate with this one. See if the table prefixing suggestion (#9) in that issue helps you.

David Lesieur’s picture

Version: 5.x-1.0-beta3 » 5.x-1.x-dev
Status: Active » Fixed

The initial division by zero issue is now fixed.

Actually, it is avoided. A search and a count query are both required in Faceted Search in order to show the number of items found. Those queries being conveniently performed by pager_query(), it means we need a pager, which means we need a limit per page greater than zero. Therefore, a Nodes per Page value of zero in a view is now ignored by Faceted Search (and replaced by Drupal's main Number of posts per page). Values greater than zero are still supported as before.

Thanks for having reported the issue!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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