Commit 34f633e4 authored by Dries's avatar Dries

- Patch #1003308 by bfroehle: forum module cannot decide if it wants...

- Patch #1003308 by bfroehle: forum module cannot decide if it wants 'taxonomy_forums()' hardcoded in it leading to faulty functioning.
parent 55417768
......@@ -46,7 +46,7 @@ function forum_enable() {
// Create the 'taxonomy_forums' field if it doesn't already exist.
if (!field_info_field('taxonomy_forums')) {
$field = array(
'field_name' => 'taxonomy_' . $vocabulary->machine_name,
'field_name' => 'taxonomy_forums',
'type' => 'taxonomy_term_reference',
'settings' => array(
'allowed_values' => array(
......@@ -73,7 +73,7 @@ function forum_enable() {
// Create the instance on the bundle.
$instance = array(
'field_name' => 'taxonomy_' . $vocabulary->machine_name,
'field_name' => 'taxonomy_forums',
'entity_type' => 'node',
'label' => $vocabulary->name,
'bundle' => 'forum',
......@@ -234,3 +234,10 @@ function forum_schema() {
return $schema;
}
/**
* Implements hook_update_last_removed().
*/
function forum_update_last_removed() {
return 7002;
}
......@@ -169,12 +169,9 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) {
$tid = (isset($router_item['page_arguments'][0]) ? $router_item['page_arguments'][0]->tid : 0);
$forum_term = forum_forum_load($tid);
if ($forum_term) {
$vid = variable_get('forum_nav_vocabulary', 0);
$vocabulary = taxonomy_vocabulary_load($vid);
$links = array();
// Loop through all bundles for forum taxonomy vocabulary field.
$field = field_info_field('taxonomy_' . $vocabulary->machine_name);
$field = field_info_field('taxonomy_forums');
foreach ($field['bundles']['node'] as $type) {
if (node_access('create', $type)) {
$links[$type] = array(
......
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