From 3a4912c843f45fb9942c7860f5b655bbda34d0dd Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Wed, 29 Apr 2009 18:53:38 +0000 Subject: [PATCH] #197864 by vito_swat, alpritt, Murz, catch: Use hook_term_path() in forum module instead of hook_link_alter(); simplfies code, improves performance and compatibility. --- modules/forum/forum.module | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 1d551329d6fe..a84bfa041412 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -645,18 +645,8 @@ function _forum_parent_select($tid, $title, $child_type) { return array('#type' => 'select', '#title' => $title, '#default_value' => $parent, '#options' => $options, '#description' => $description, '#required' => TRUE); } -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. 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']); - } - } - } +function forum_term_path($term) { + return 'forum/'. $term->tid; } /**