Closed (fixed)
Project:
autocategorise
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2008 at 00:27 UTC
Updated:
15 Dec 2008 at 02:06 UTC
I'd like to see the module assign terms with synonyms and the terms themselves. To do this, I altered the SQL:
**From**
function get_array_for_matching($vid){
$db_result = db_query("
SELECT t.tid, s.name
FROM {term_data} AS t LEFT JOIN term_synonym AS s
ON t.tid = s.tid
WHERE vid = %d AND s.name IS NOT NULL
ORDER BY s.tid", $vid);
while ($term = db_fetch_object($db_result)){
$synonyms[$term->tid][]=$term->name;
}
return $synonyms;
}
**To**
function get_array_for_matching($vid){
$db_result = db_query("
SELECT t.tid, t.name
FROM {term_data} as t
WHERE vid = %d
UNION
SELECT t.tid, s.name
FROM {term_data} AS t LEFT JOIN term_synonym AS s
ON t.tid = s.tid
WHERE vid = %d AND s.name IS NOT NULL
", $vid, $vid);
while ($term = db_fetch_object($db_result)){
$synonyms[$term->tid][]=$term->name;
}
return $synonyms;
}
Comments
Comment #1
matslats commentedThis is now the default and only behaviour.
I didn't use this sql though, I did something less elegant, but with less code.
Comment #2
matslats commented