summaryrefslogtreecommitdiff
path: root/modules/forum/forum.install
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-12-31 16:58:34 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-12-31 16:58:34 +0000
commit4157a521e0899622509022170c2be89da029c291 (patch)
treee1dc4051017fc0f211338f3646536bbd8b72ecdd /modules/forum/forum.install
parent6bb7647f0b42d1bd0ba5d3427433d9a1cc4ffda3 (diff)
downloadbrdo-4157a521e0899622509022170c2be89da029c291.tar.gz
brdo-4157a521e0899622509022170c2be89da029c291.tar.bz2
#199373 report by avskip, patch by myself, testing by keith.smith: forum node type was not re-added to the forum vocabulary when the module is re-enabled (after being disabled)
Diffstat (limited to 'modules/forum/forum.install')
-rw-r--r--modules/forum/forum.install19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/forum/forum.install b/modules/forum/forum.install
index 62035955f..ff9ac135b 100644
--- a/modules/forum/forum.install
+++ b/modules/forum/forum.install
@@ -12,12 +12,17 @@ function forum_install() {
}
function forum_enable() {
- // Create the forum vocabulary if it does not exist. Assign the vocabulary
- // a low weight so it will appear first in forum topic create and edit
- // forms.
- $vid = variable_get('forum_nav_vocabulary', 0);
- $vocabularies = taxonomy_get_vocabularies();
- if (!isset($vocabularies[$vid])) {
+ if ($vocabulary = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary', 0))) {
+ // Existing install. Add back forum node type, if the forums
+ // vocabulary still exists. Keep all other node types intact there.
+ $vocabulary = (array) $vocabulary;
+ $vocabulary['nodes']['forum'] = 1;
+ taxonomy_save_vocabulary($vocabulary);
+ }
+ else {
+ // Create the forum vocabulary if it does not exist. Assign the vocabulary
+ // a low weight so it will appear first in forum topic create and edit
+ // forms.
$vocabulary = array(
'name' => t('Forums'),
'multiple' => 0,
@@ -123,4 +128,4 @@ function forum_update_6000() {
}
return $ret;
-} \ No newline at end of file
+}