Commit 226eed70 authored by Dries's avatar Dries

- Patch #67146 by webchick: make sure that the forum vocabulary shows up first.

parent 4c3e7443
......@@ -2060,3 +2060,14 @@ function system_update_184() {
return $ret;
}
function system_update_185() {
// Make the forum's vocabulary the highest in list, if present
$ret = array();
if ($vid = variable_get('forum_nav_vocabulary', 0) {
db_query('UPDATE {vocabulary} SET weight = %d WHERE vid = %d', -10, $vid);
}
return $ret;
}
......@@ -658,7 +658,9 @@ function _forum_get_vid() {
// Check to see if a forum vocabulary exists
$vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module = '%s'", 'forum'));
if (!$vid) {
$edit = array('name' => 'Forums', 'multiple' => 0, 'required' => 1, 'hierarchy' => 1, 'relations' => 0, 'module' => 'forum', 'nodes' => array('forum' => 1));
// Create the forum vocabulary. Assign the vocabulary a low weight so
// it will appear first in forum topic create and edit forms.
$edit = array('name' => 'Forums', 'multiple' => 0, 'required' => 1, 'hierarchy' => 1, 'relations' => 0, 'module' => 'forum', 'weight' => -10, 'nodes' => array('forum' => 1));
taxonomy_save_vocabulary($edit);
$vid = $edit['vid'];
}
......
......@@ -658,7 +658,9 @@ function _forum_get_vid() {
// Check to see if a forum vocabulary exists
$vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module = '%s'", 'forum'));
if (!$vid) {
$edit = array('name' => 'Forums', 'multiple' => 0, 'required' => 1, 'hierarchy' => 1, 'relations' => 0, 'module' => 'forum', 'nodes' => array('forum' => 1));
// Create the forum vocabulary. Assign the vocabulary a low weight so
// it will appear first in forum topic create and edit forms.
$edit = array('name' => 'Forums', 'multiple' => 0, 'required' => 1, 'hierarchy' => 1, 'relations' => 0, 'module' => 'forum', 'weight' => -10, 'nodes' => array('forum' => 1));
taxonomy_save_vocabulary($edit);
$vid = $edit['vid'];
}
......
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