The default autocomplete feature does not work and gives me following error:
Notice: Undefined variable: eid in finder_autocomplete_autocomplete() (line 376 of …/modules/finder/plugins/element_handler/autocomplete.inc)

This happens in 7.x-2.x-dev and 7.x-2.x-rc2 as well.

Comments

Georgii’s picture

Status: Active » Needs review

I have the same, however autocomplete works for me. I think there is a problem with this piece of code:
…/modules/finder/plugins/element_handler/autocomplete.inc from 370

$finder->find = array(
    'mode' => 'choices',
    'matches' => array(
       $element->id => array(
         'match' => $finder->esetting($element, 'autocomplete_match'),
         'match_x' => array(
            'operator' => $finder->esetting($finder->elements[$eid], 'autocomplete_match_custom_operator', '='),
            'value_prefix' => $finder->esetting($finder->elements[$eid], 'autocomplete_match_custom_prefix'),
            'value_suffix' => $finder->esetting($finder->elements[$eid], 'autocomplete_match_custom_suffix'),
         ),
       ),
     ),

I suppose that this $eid is actually an $element_id. After a small replacement it stopped throwing and error.

  $finder->find = array(
    'mode' => 'choices',
    'matches' => array(
       $element->id => array(
         'match' => $finder->esetting($element, 'autocomplete_match'),
         'match_x' => array(
            'operator' => $finder->esetting($finder->elements[$element_id], 'autocomplete_match_custom_operator', '='),
            'value_prefix' => $finder->esetting($finder->elements[$element_id], 'autocomplete_match_custom_prefix'),
            'value_suffix' => $finder->esetting($finder->elements[$element_id], 'autocomplete_match_custom_suffix'),
         ),
       ),
     ),

Hope it will work for you also

jdlind38’s picture

This also worked for me in version 7.x-2.0. Thanks for the fix.

nikkubhai’s picture

Weird, in my case, autocomplete works for admin user but not for normal user.

Georgii’s picture

nikkubhai, is it the same issue or a different one?

Miguel.Andrade’s picture

Yap, #1 solved it for me too. tnx

NicoDruif’s picture

I had exactly the same error, and the proposed fix worked for me too!

wxman’s picture

Same here. It was driving me crazy trying to fix it.

PaperWeight’s picture

Good fix

mvdve’s picture

nikkubhai , You are probably searching for content where only the administrator has viewing wrights.
For example commerce product fields etc.

amanire’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.15 KB

Works for me. Here's a patch from #1. Looks like a straightforward bug fix.

danielb’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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