By DRagonRage on
slight change to a query from taxonomy module at drupal 5 makes autocomplete search synonym made possible.
here is the change to function: taxonomy_autocomplete
line:1498 => old:
$result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = %d AND LOWER(t.name) LIKE LOWER('%%%s%%')", 't', 'tid'), $vid, $last_string, 0, 10);
new:
$result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t,{term_synonym} ts WHERE t.vid = %d AND LOWER(t.name) LIKE LOWER('%%%s%%') OR ts.tid = t.tid AND ts.name LIKE LOWER('%%%s%%')", 't', 'tid'), $vid, $last_string, 0, 10);
Comments
Try form_altering
Useful. To avoid patching core, you could in a custom module, register a process callback for textfields using
hook_elements()) to assign a different autocomplete_path calling your callback. Something like:Thanks:
thak you very much , and yes i kinda feel bad for changin core and I suspect i did some dmg to infrastructure(results coming wrong) ,
im a PHP developper and drupal has its oun code or "ethics" that i find to addopt for my current drupal baset project - i cant find the right guide -- the handbooks are great but too specific and therefore allot to read the terminology is really differnt from joomla, iil be glad if you point me to an article called :drupal for the old school php developper ;)
thanks again iil search for form_altering+drupal+hook on google ,
-----
cheers! Leon.
Correction
I think this code was not correct, it must be
See http://drupal.org/node/405048#comment-2973600