I’m on Drupal 7. finder works perfectly. I use the Rewrite choices for element title ( I use only the title element). I put 6 for Max suggestions, but the list displayed in the autocomplete search field does not comply with this limitation. Is there still a bug to fix for Drupal 7 finder module?
Many thanks

CommentFileSizeAuthor
#6 print_screen.jpg146.67 KBripcurl
#4 finder_export.txt2.6 KBripcurl
#4 print_screen.jpg75.07 KBripcurl

Comments

danielb’s picture

What do you mean by 'does not comply' ? Is it showing more than 6?

ripcurl’s picture

Yes, it continues to display all the results.

danielb’s picture

Works fine for me.
Can you provide an export of your finder?

ripcurl’s picture

StatusFileSize
new75.07 KB
new2.6 KB

Hi,
Thanks for helping me.
You will find attached an export of my finder and a print screen on which we can see that all results are still displayed without taking into account the limit of 6.
Sorry there are a few french comments in the export.

danielb’s picture

hmm I can't spot anything wrong with your finder
Anything strange about the views plugins used or pager settings in the views display?

ripcurl’s picture

StatusFileSize
new146.67 KB

I have the last version of the views pluggin (printscreen of my views modules attached).
What view should I check?
I checked the 2 views “Finder node” and “Finder user” (I did no change before on these views ). They have a pagination to 10 items. Should I check other parameters in these views ?

danielb’s picture

By plugin I'm not referring to modules, it's something within views or provided by any other module.

You checked "finder node" and "finder user" views - however your finder appears to be using neither of these. It is using a view called "vue_annuaire_membres"?

ripcurl’s picture

Ok you've got it.
I did not use paging in the view "vue_annuaire_membres".
As this view is used for the contents of the results page, I did not think the number of results displayed in the finder was impacted.
The trouble is I do not want to limit the number of results on the page but limit it in the Finder.
In order to get around the problem, I used pagination in the view "vue_annuaire_membres" and set 100 as a limit.
Finder respect now the limit of 6 results and I can have more than 6 items displayed on the result page.
Everything is ok now. We just have to know that if we do not use pagination in the view of the results page, finder does not take into account the limit specified in the finder parameters.

Many thanks for your help and your work on this module.

danielb’s picture

Hmm so are you saying pagination must be enabled in a View for finder's limits to take affect? I wasn't aware of that, I think there is a way to fix it.
FYI, you can also create a new 'display' to use specifically for finder within the view's admin, and then configure that as the display for the autocomplete finder element. This way you can essentially configure the view differently for the results page.

danielb’s picture

I remember dealing with the opposite issue (turning pagination off) with Views in another module: #1278138: Specifying nodes through a view only returns 10 results

danielb’s picture

Weird it should already activate the pager, and then set the size:

<?php

      // Limit result set size.
      if (isset($pager)) {
        $view->display_handler->set_option('use_pager', TRUE);
        $view->display_handler->set_option('items_per_page', $pager);
        $pager_element = ($mode == 'results') ? 0 : 'finder_choices_' . $element->id;
        $view->display_handler->set_option('pager_element', $pager_element);
      }
?>

I know I'm saying 'pager' instead of limit, but that's the functionality used to get the limiting effect.

danielb’s picture

if i change the code in finder.inc views_find() like this it seems to work, but i'm not sure this is the best way to do it?

<?php
      // Limit result set size.
      if (isset($pager)) {
        $view->display_handler->set_option('use_pager', TRUE);
        $view->display_handler->set_option('items_per_page', $pager);
        $pager_element = ($mode == 'results') ? 0 : 'finder_choices_' . $element->id;
        $view->display_handler->set_option('pager_element', $pager_element);


        $pager_option = $view->display_handler->get_option('pager');
        if ($pager_option['type'] == 'none' && $pager) {
          $pager_option['type'] = 'some';
          $view->display_handler->set_option('pager', $pager_option);
        }
      }
?>
danielb’s picture

Status: Active » Fixed

Alright well we'll go with that for now, i've added a comment in the code pointing back to this issue. The code is actually in two places.

Status: Fixed » Closed (fixed)

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