diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-20 21:43:01 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-20 21:43:01 +0000 |
commit | 789cba51f54fbfad21c33b3e2c9cbcbc10c46ff2 (patch) | |
tree | 50f07f11876c472370b2c023763fcedf6ceeb5d0 /modules/forum/forum.install | |
parent | bca913100a67029a67f4ff86721fe0290db88fc9 (diff) | |
download | brdo-789cba51f54fbfad21c33b3e2c9cbcbc10c46ff2.tar.gz brdo-789cba51f54fbfad21c33b3e2c9cbcbc10c46ff2.tar.bz2 |
#186546 by bjaspan: fix missing forum vocabulary when people turned on forum module, but never visited any pages in Drupal 5 and they upgrade to Drupal 6 which does this much better
Diffstat (limited to 'modules/forum/forum.install')
-rw-r--r-- | modules/forum/forum.install | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/forum/forum.install b/modules/forum/forum.install index 76b66a267..7d2d0c428 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -91,3 +91,33 @@ function forum_schema() { return $schema; } + +/** + * Create the forum vocabulary if does not exist. Assign the + * vocabulary a low weight so it will appear first in forum topic + * create and edit forms. Do not just call forum_enable() because in + * future versions it might do something different. + */ +function forum_update_6000() { + $ret = array(); + + $vid = variable_get('forum_nav_vocabulary', 0); + $vocabularies = taxonomy_get_vocabularies(); + if (!isset($vocabularies[$vid])) { + $vocabulary = array( + 'name' => t('Forums'), + 'multiple' => 0, + 'required' => 0, + 'hierarchy' => 1, + 'relations' => 0, + 'module' => 'forum', + 'weight' => -10, + 'nodes' => array('forum' => 1), + ); + taxonomy_save_vocabulary($vocabulary); + + variable_set('forum_nav_vocabulary', $vocabulary['vid']); + } + + return $ret; +}
\ No newline at end of file |