Commit f81bbb96 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#422218 by salvis, jeremiah.snapp: fix a case in forum module where non forum...

#422218 by salvis, jeremiah.snapp: fix a case in forum module where non forum tids might get picked as the forum topic tid
parent fecd9638
......@@ -255,7 +255,7 @@ function forum_nodeapi(&$node, $op, $teaser, $page) {
$node->tid = $term_id;
}
}
$old_tid = db_result(db_query_range("SELECT t.tid FROM {term_node} t INNER JOIN {node} n ON t.vid = n.vid WHERE n.nid = %d ORDER BY t.vid DESC", $node->nid, 0, 1));
$old_tid = db_result(db_query_range("SELECT f.tid FROM {forum} f INNER JOIN {node} n ON f.vid = n.vid WHERE n.nid = %d ORDER BY f.vid DESC", $node->nid, 0, 1));
if ($old_tid && isset($node->tid) && ($node->tid != $old_tid) && !empty($node->shadow)) {
// A shadow copy needs to be created. Retain new term and add old term.
$node->taxonomy[] = $old_tid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment