Change autocomplete path with hook_form_alter() I'm trying to change the autocomplete path of a node reference field (References module) with a custom module using hook_form_alter().
I have no problem changing any property of the field except the ["#autocomplete_path']. when I set another value for this, the field loses its autocomplete feature. (The hidden autocomplete field isn't there anymore as well) I find this totally weird, and haven't found anything about this in issue queues or anything like that. 

Just FYI, I've setup a new MENU_CALLBACK path with hook_menu() and a callback function, so I'll be able to return JSON suggestions depending on some custom parameters and the value of another field.
On a stock installation of Drupal 7 and references 7.x-2.0-beta3 I was able to use the following form alter to successfully change the autocomplete path for a node reference field on the article content type:

function YOURMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'article_node_form') {
    $form['field_node_ref'][LANGUAGE_NONE][0]['nid']['#autocomplete_path'] = 'another/url';
  }
}


Another option is to ignore the form and use hook_menu_alter to change the callback for node_reference/autocomplete/%/%/%. Your callback should accept $entity_type, $bundle, $field_name which you can use to filter out which requests you want to respond to.