Drupal 6 and 7 still exhibit longstanding quirks with autocomplete fields (where search results appear in a popup list as you type). For the most part autocomplete fields work as-advertised, but somehow they get confused by the humble slash ( / ) character.

In Drupal 6 everything following the first slash in your autocomplete field will be ignored in the autocomplete query. The reason this happens is because autocomplete sends its query to Drupal as a path component, and the Drupal path system throws away anything following the first slash (even if the slash was encoded, which it isn't anyway).

In Drupal 7 the problem is less serious but still wrong. Trailing slashes are ignored in the autocomplete query, so you can't do an autocomplete on the slash character by itself, or as the last character in an autocomplete query.

This module, and its companion module Autocomplete POST, get around these issue by overriding the behavior of all your previously-installed autocomplete fields. The Autocomplete POST module causes autocomplete fields to submit their contents in a POST header, bypassing the path parameter altogether. The Autocomplete Hack module still submits the search terms through a path parameter, but it specially encodes slashes so they won't get swallowed by the path parser.

Project information

Releases