I just upgraded from Drupal 6.4 to Drupal 6.6. I have a custom autocomplete feature on my main search form (search_block_form). After I upgraded, the form stopped autocompleting, even when I'm User 1. I assume it has to do with the fact that autocomplete is turned off in D6.6 when the user does not have the right permissions. But I can't figure out why I don't have the necessary permissions.
Here's the relevant menu item:
// Return autocomplete matches for search
$items['foo/autocomplete/%menu_tail'] = array(
'access callback' => 'user_access',
'access arguments' => array('search content'),
'page callback' => 'foo_autocomplete',
'page arguments' => array(2),
'type' => MENU_CALLBACK,
);
(I've also tried 'access callback' => TRUE and 'access arguments' => array('access content').)
Any thoughts?
Comments
Comment #1
dave reidHave you just tried loading the autocomplete URL to make sure it is returning valid data?
Comment #2
grobemo commentedYep. Going directly to the autocomplete URL returns exactly what it should (in JSON format). I've tested it as an anonymous user and as user 1.
Comment #3
grobemo commentedIt turns out the problem with the Teleport module's autocomplete in D6.6 was the same, as was the solution: eliminate %menu_tail from the key in $items.
In other words, my code now looks like this:
The only change is that I deleted '/%menu_tail'. After clearing the cache to reset the menu, autocomplete is back.
I have no idea why this works, because I've never fully understood %menu_tail. But it works.
Comment #4
veeraprasadd commentedClick here : Test Autocomplete form