Index: taxonomy_hide.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_hide/taxonomy_hide.module,v retrieving revision 1.6 diff -u -F^function -r1.6 taxonomy_hide.module --- taxonomy_hide.module 27 Dec 2006 14:10:01 -0000 1.6 +++ taxonomy_hide.module 30 Jan 2007 23:41:08 -0000 @@ -76,19 +76,21 @@ function taxonomy_hide_nodeapi(&$node, $ switch ($op) { case 'view': - # Get all hidden vocabularies; keys of $hidden are the vocabulary ids. - $hidden = array_filter(variable_get('taxonomy_hide_vocabularies', array())); - if (count($hidden)) { - # Hide terms by removing them from the taxonomy field - foreach ($node->taxonomy as $key => $value) { - if (array_key_exists($value->vid, $hidden)) { - unset($node->taxonomy[$key]); - } - } - } - if (variable_get('taxonomy_hide_group_by_vocabulary', 0)) { - # Sort terms by sorting the taxonomy field - usort($node->taxonomy, "_taxonomy_hide_sort"); + if (count($node->taxonomy)) { + // Get all hidden vocabularies; keys of $hidden are the vocabulary ids. + $hidden = array_filter(variable_get('taxonomy_hide_vocabularies', array())); + if (count($hidden)) { + // Hide terms by removing them from the taxonomy field + foreach ($node->taxonomy as $key => $value) { + if (array_key_exists($value->vid, $hidden)) { + unset($node->taxonomy[$key]); + } + } + } + if (variable_get('taxonomy_hide_group_by_vocabulary', 0)) { + // Sort terms by sorting the taxonomy field + usort($node->taxonomy, "_taxonomy_hide_sort"); + } } break; }