Hi

First thanks for the module, this is just what I need. I'm using it for an author field, the autocomplete feature helps to write the author name always the same way. My problem is that when I created a node I typed "Drubeck, Dave", then I corrected to "Dave Brubeck", and now when creating a new node the autocomplete shows both. So, I think would be nice if this module could show only the values of the current versions of the nodes. Maybe you can use a WHERE clause of this kind:

WHERE {node}.vid = {content_field_autor}.vid 
AND {node}.nid = {content_field_autor}.nid

Comments

drupalnesia’s picture

Status: Active » Closed (fixed)
$sql = 'SELECT f.'. $column .' FROM {'. $table .'} f WHERE '. implode(' AND ', $where) .' ORDER BY f.'. $column;
  if (!empty($field['widget']['i18n_flddata'])) {
    // Adding a join with the node table allows the i18n rewrite the query
    // to filter values from node for the proper language.
    $sql = db_rewrite_sql(str_replace(' WHERE ', ' INNER JOIN {node} n ON f.vid = n.vid WHERE ', $sql));
  }

Look like "Autocomplete Widgets" already used current node version. Make sure you clear Drupal cache.