Patching Drupal core (misc/autocomplete.js)

Last updated on
30 April 2025

There is an issue in the search box with autocompletion. If the user hit enter at the end of a search term, the expected behaviour would be to start searching. However if the search box is connected to an autocompletion feature, the enter only hides the autocomplete popup, and only the second enter starts the searching. This is a Drupal core behaviour, and since it is not something we can override with the help of the hook system (it is JavaScript functionality), we provided a patch against Drupal core, namely the file misc/autocomplete.js. You can apply the patch with

 git apply sites/all/modules/xc/xc_util/patches/xc-autocomplete.patch

or

 patch -p1 < sites/all/modules/xc/xc_util/patches/xc-autocomplete.patch

You can find more info about applying patches at Drupal's Patch guide (http://drupal.org/patch/apply) or in case of problems the following page: http://drupal.org/node/1129120.

The patch will change the misc/autocomplete.js file a little bit. The most important change is that instead of the original

 }).size() == 0;

you will see

  }); // }).size() == 0;
  return 1;

around line 29.

Help improve this page

Page status: Not set

You can: