Commit cf3bfe00 authored by Dries's avatar Dries

- Patch #18260 by Morbus: fixed taxonomy links.

parent 9b8733bc
......@@ -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']);
}
}
}
}
......
......@@ -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']);
}
}
}
}
......
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