From cf3bfe006bd9fa5aedac03fe88cb3229df4dab3e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 29 May 2006 12:58:19 +0000 Subject: - Patch #18260 by Morbus: fixed taxonomy links. --- modules/forum/forum.module | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modules/forum/forum.module') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 922df1eb0..4ec9da74a 100644 --- a/modules/forum/forum.module +++ b/modules/forum/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']); + } } } } -- cgit v1.2.3