Hi,
all the options displayed by the autocomplete widget are all the present options in the resoults but when writting in the exposed field the number of results doesn't reduce.

I propouse a hack that works for me, what do you think about?

At file views_autocomplete_filters.inc add a condition in the if inside foreach:

 foreach ($view->result as $id => $row) {
   // Add a class wrapper for a few required CSS overrides.
         if (!empty($row->$field_alias) && strstr(drupal_strtoupper($row->$field_alias),drupal_strtoupper($string))) { //added condition
            $matches[$row->$field_alias] = '<div class="reference-autocomplete">'. $row->$field_alias .'</div>';
         }
 }

thanks a lot for your work, really nice module!

Comments

teflo’s picture

Thanks quiron!

vasike’s picture

thanks

but this is something that could be achieved with the operator of the field, if you choose "Contains" operator and no Case sensitive in the filter definition
please let me know if i'm wrong.

jvdurme’s picture

Priority: Normal » Major

Hi there,

it doesn't work. when I choose "Contains" as operator, no matter what I type in the field, the autocomplete will show all view results and not just those that matches what is typed.
I would call this a serious drawback of what can be a really interesting module.

arski’s picture

same issue here with the contains operator.. always shows all values (well, the first 10 sorted alphabetically it seems) regardless of what I type in :(

vasike’s picture

please check the last dev : 6.x-1.x-dev

arski’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

this seems to work solidly in the "Default" preview now.. sadly not in the Page preview, or on the actual page :(

arski’s picture

I'm not 100% sure, but this looks increasingly a duplicate of #1104744: Works only in live preview / default view. All the issues in here are fixed with the patch in there for me.

vasike’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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