--- drupal-4.6.3/modules/taxonomy_assoc/taxonomy_assoc.module.orig	2005-11-29 10:40:16.000000000 +0000
+++ drupal-4.6.3/modules/taxonomy_assoc/taxonomy_assoc.module	2005-12-02 13:05:52.000000000 +0000
@@ -472,7 +472,12 @@
  * By Jaza, on 2005-03-29.
  */
 function taxonomy_assoc_count_nodes_nochild($tid) {
-  $result = db_query('SELECT t.tid, COUNT(DISTINCT(n.nid)) AS c FROM {term_node} t '. node_access_join_sql() .'INNER JOIN {node} n ON t.nid = n.nid WHERE n.status = 1 AND '. node_access_where_sql() .'GROUP BY t.tid');
+  if (_node_access_where_sql()) {
+    $where = 'AND ' . _node_access_where_sql();
+  } else {
+    $where = '';
+  }
+  $result = db_query('SELECT t.tid, COUNT(DISTINCT(n.nid)) AS c FROM {term_node} t '. _node_access_join_sql() .' INNER JOIN {node} n ON t.nid = n.nid WHERE n.status = 1 ' .  $where . ' GROUP BY t.tid');
   
   while ($term = db_fetch_object($result)) {
     $count[$type][$term->tid] = $term->c;
