Skip to content
Snippets Groups Projects
Commit defed7ec authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #197864 by vito_swat, alpritt, Gurpartap Singh et al: forum module...

- Patch #197864 by vito_swat, alpritt, Gurpartap Singh et al: forum module uses hook_link_alter instead of taxonomy_term_path hook.
parent b9eb3c89
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -464,19 +464,11 @@ function forum_form(&$node, $form_state) {
return $form;
}
function forum_link_alter(&$links, $node) {
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']);
$vid = variable_get('forum_nav_vocabulary', '');
$term = taxonomy_get_term($tid);
if ($term->vid == $vid) {
$links[$module]['href'] = str_replace('taxonomy/term', 'forum', $link['href']);
}
}
}
/**
* Implementation of hook_term_path().
*/
function forum_term_path($term) {
return 'forum/' . $term->tid;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment