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.module | |
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.module')
-rw-r--r-- | modules/forum/forum.module | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 674077dea..3546b4f66 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -161,8 +161,15 @@ 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', ''); $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)) { |