summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/forum.module9
-rw-r--r--modules/forum/forum.module9
2 files changed, 14 insertions, 4 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']);
+ }
}
}
}
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']);
+ }
}
}
}