Index: modules/forum/forum.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v
retrieving revision 1.12
diff -u -F^f -r1.12 forum.install
--- modules/forum/forum.install	11 Dec 2007 10:52:00 -0000	1.12
+++ modules/forum/forum.install	12 Dec 2007 14:18:19 -0000
@@ -91,3 +91,33 @@ function forum_schema() {
 
   return $schema;
 }
+
+/**
+ * Create the forum vocabulary which did not exist prior to D6. 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
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.431
diff -u -F^f -r1.431 forum.module
--- modules/forum/forum.module	11 Dec 2007 10:52:00 -0000	1.431
+++ modules/forum/forum.module	12 Dec 2007 14:18:20 -0000
@@ -157,8 +157,18 @@ function forum_init() {
  * Implementation of hook_nodeapi().
  */
 function forum_nodeapi(&$node, $op, $teaser, $page) {
+  // We are going to return if $node->type is not one of the node
+  // types assigned to the forum vocabulary.  If forum_nav_vocabulary
+  // is undefined or the vocabulary does not exist, it clearly cannot
+  // be assigned to $node->type, so return to avoid E_ALL warnings.
   $vid = variable_get('forum_nav_vocabulary', '');
+  if (empty($vid)) {
+    return;
+  }
   $vocabulary = taxonomy_vocabulary_load($vid);
+  if (empty($vocabulary)) {
+    return;
+  }
 
   // Operate only on node types assigned for the forum vocabulary.
   if (!in_array($node->type, $vocabulary->nodes)) {
