diff options
Diffstat (limited to 'modules/forum.module')
-rw-r--r-- | modules/forum.module | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/forum.module b/modules/forum.module index 922df1eb0..4ec9da74a 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -638,8 +638,13 @@ function _forum_parent_select($tid, $title, $child_type) { function forum_link_alter(&$node, &$links) { foreach ($links AS $module => $link) { if (strstr($module, 'taxonomy_term')) { - // Link back to the forum and not the taxonomy term page - $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + // Link back to the forum and not the taxonomy term page. We'll only + // do this if the taxonomy term in question belongs to forums. + $tid = str_replace('taxonomy/term/', '', $link['#href']); + $term = taxonomy_get_term($tid); + if ($term->vid == _forum_get_vid()) { + $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + } } } } |