diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-06-06 15:35:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-06-06 15:35:39 +0000 |
commit | 226eed7047e51fe0c2fc68db89f6a1bfbe8353d4 (patch) | |
tree | 9a9f74c999b8a64ae63c3cfad232f853629d9ab1 | |
parent | 4c3e7443c74f04514673efefa7375e1592d53408 (diff) | |
download | brdo-226eed7047e51fe0c2fc68db89f6a1bfbe8353d4.tar.gz brdo-226eed7047e51fe0c2fc68db89f6a1bfbe8353d4.tar.bz2 |
- Patch #67146 by webchick: make sure that the forum vocabulary shows up first.
-rw-r--r-- | database/updates.inc | 11 | ||||
-rw-r--r-- | modules/forum.module | 4 | ||||
-rw-r--r-- | modules/forum/forum.module | 4 |
3 files changed, 17 insertions, 2 deletions
diff --git a/database/updates.inc b/database/updates.inc index 18079b901..f0249be0f 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -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; +} + diff --git a/modules/forum.module b/modules/forum.module index 4ec9da74a..9335271c4 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -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']; } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 4ec9da74a..9335271c4 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -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']; } |