Index: modules/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v retrieving revision 1.267 diff -u -F^f -r1.267 taxonomy.module --- modules/taxonomy.module 24 Mar 2006 14:49:45 -0000 1.267 +++ modules/taxonomy.module 31 Mar 2006 09:22:49 -0000 @@ -588,6 +588,20 @@ function taxonomy_get_vocabularies($type } /** + * Return TRUE if a node has vocabularies connections. + * + * @param $node + * + */ +function taxonomy_node_in_vocabularies($node) { + $result = db_fetch_object(db_query("SELECT count(vid) found FROM {vocabulary_node_types} WHERE type = '%s' LIMIT 1", $node->type)); + if ($result->found) { + return TRUE; + } + return FALSE; +} + +/** * Generate a form for selecting terms to associate with a node. */ function taxonomy_form_alter($form_id, &$form) { @@ -1136,6 +1150,11 @@ function taxonomy_render_nodes($result) * Implementation of hook_nodeapi(). */ function taxonomy_nodeapi($node, $op, $arg = 0) { + if (!taxonomy_node_in_vocabularies($node)) { + //Do not run all the hooks for nodes that have no taxonomy association + return; + } + switch ($op) { case 'load': $output['taxonomy'] = taxonomy_node_get_terms($node->nid);