I have a CCK multiple values text field. Inside views, added an auto-complete using views autocomplete.
Working as expected in live preview, where as node ids are returned in page display created.

To force usage of defaults, temporarily just kept $view_display = "default";, locally, as a first line in function views_autocomplete_filter, and its working as expected.

I am wondering if this is a bug/expected behaviour/i am doing some thing wrong

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vasike’s picture

What do you mean by not working. What errors do you have?

vasike’s picture

Status: Active » Postponed (maintainer needs more info)
ravuriharish’s picture

Status: Postponed (maintainer needs more info) » Needs work

where as node ids are returned in page display created

vasike’s picture

Status: Needs work » Postponed (maintainer needs more info)

unfortunately i can't get it.
can you provide some printscreens with the views settings and views results?

ravuriharish’s picture

FileSize
239.04 KB

Attached screen shot of autocomplete, which is showing up node ids as options.
In the function views_autocomplete_filter($field_name = NULL, $view_name, $view_display, $string = '') if i check for my view name and set to use default view_display, working as expected.

vasike’s picture

please check if there are differences between the default and the pages displays settings.
can you provide also some printscreens with those settings.

Hanno’s picture

have the same issue, getting the nid's instead of the titles.

drupalnesia’s picture

Me too, but this happen when I use CCK3 Multigroup.

I can't make autocomplete works for Product Code, my content-type like this:

Sales Order --> contains Product Code (this is a Multigroup field).

Does this module support CCK3 Multigroup field?

rolkos’s picture

Version: 6.x-1.2 » 7.x-1.0-beta1
Status: Postponed (maintainer needs more info) » Active
FileSize
23.45 KB
44.26 KB
11.17 KB
24.18 KB
35.6 KB

I noticed same issue on D7. When I'm entering some string I'm getting NID in dropdown list. What’s more if field that I'm using use rewrite with tokens and I uncheck "Unformatted" on autocomplete configuration form, it display token name not rewritten value.
If I use plain text in field text on dropdown list is correct but when I select one value in form field Nid is displayed.

Please take a look at attached screenshots.

I'm not sure if its directly related but after I enabled autocomplete module I'm gettigh this warning on view configuration form.

Warning: Illegal string offset 'format' in views_object->unpack_translatable() (line 330 of V:\htdocs\familjesidan.dev\sites\all\modules\contrib\views\includes\base.inc).

rolkos’s picture

Priority: Normal » Major
robertom’s picture

Sorry for my bad english.

I have same problem of #9... I use field rewrited with token, but rewrite isn't applied.

I will try to deepen this bug a bit

robertom’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
robertom’s picture

Title: Autocomplete working in Live Preview, not working in Page display » Token rewrite not working in Page display
Status: Active » Needs review
FileSize
2.79 KB

I have an exposed filter with autocomplete on field "Title" and "unformatted dropdown" unchecked. (exposed form in block)

"Title" field use rewrite results capability. Text on rewrite results is: [field_nome_prodotto]

with dev version In the dropdown I receive:

[field_nome_prodotto]
[field_nome_prodotto]
[field_nome_prodotto]
[field_nome_prodotto]

instead of the rewrited value.

For fix this problem I have made the following patch

robertom’s picture

Status: Needs review » Needs work

Sorry,

I reset this issue as needs works, becouse is needed a rewrite of the following part (included comments)


  if (empty($field_options)) {
    // Field not exists, report about it to watchdog and return empty array.
    watchdog('views_autocomplete_filters', 'Field for autocomplete filter %label not exists in view %view, display %display', array(
      '%label' => $expose_options['label'],
      '%view' => $view->name,
      '%display' => $display->id,
    ), WATCHDOG_ERROR);
    return drupal_json_output(array());
  }

  // Overwrite the fields for the view with only one field we need.

now I'm on the end of timeline for a project, so currently I don't work on this patch for some days... if someone could test the patch would be awesome

robertom’s picture

now I'm on the end of timeline for a project, so currently I don't work on this patch for some days... if someone could test the patch would be awesome

forget it..

new patch attached

robertom’s picture

Status: Needs work » Needs review
robertom’s picture

New patch that fix also some unwanted "return no results. Please try something else" when $raw_field is an array.

Patch attached

julien.reulos’s picture

Nice ! I never managed to get the autocomplete filters work with my views, but with this patch everything is working fine ! No more Ajax errors either.
So, although I do not use tokens nore exposed form in block, I guess the patch is going in the right way.
Thanks.

vasike’s picture

Status: Needs review » Fixed

patch from #17 commited http://drupalcode.org/project/views_autocomplete_filters.git/commit/20ac440
Thank you all, especially Roberto, thank you Sir.

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