In the API reference (http://api.drupal.org/), I was looking for a taxonomy function and so typed 'taxonomy_' into the AJAX field for Drupal 4.7.

I knew there was a function called 'taxonomy_select_nodes' which wasn't in the resulting list. However, when I continued to type (i.e. 'taxonomy_s'), the taxonomy_select_nodes showed up where it didn't before.

The 'taxonomy_save_vocabulary' function also showed up in the new list when it didn't appear in the first try.

So, basically, the AJAX doesn't seem to be returning the full list of available functions as you type in the request.

Comments

pnm’s picture

Title: API reference: AJAX field not finding all API functions » Autocomplete should indicate that more results were found than displayed
Project: Documentation » Drupal core
Version: » 6.x-dev
Component: Misc » javascript
Category: bug » feature

Confirmed: the full list of available functions is not returned.

api.module limits results to 20.

function api_autocomplete(..){
...
  $result = db_query("SELECT ... LIMIT 20", $search, $branch_name);
...

The taxonomy.module limits results to 10.

function taxonomy_select_nodes(..) {
...
      $result = pager_query($sql, variable_get('default_nodes_main', 10), 0, $sql_count);
    }
    else {
      $result = db_query_range($sql, 0, variable_get('feed_default_items', 10));
    }

I suggest that the results returned to the browser include count of the number of matches that were found but not returned, and that the client add a visual cue (like "more" or "2501 more") to let the user know what's happening. This would require a change to the autocomplete handler in both modules and in autocomplete.js.

Pasqualle’s picture

Version: 6.x-dev » 7.x-dev
nod_’s picture

Version: 7.x-dev » 8.x-dev
nod_’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes

Too late for 8.0.x

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.