Skip to content
Snippets Groups Projects
Commit 6a1bf824 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #14658 by Zed Pobre: fixed node-level permission bug in the taxonomy API.

parent d07d55c1
No related branches found
No related tags found
No related merge requests found
......@@ -642,7 +642,7 @@ function taxonomy_term_count_nodes($tid, $type = 0) {
if (!isset($count[$type])) {
// $type == 0 always evaluates true is $type is a string
if (is_numeric($type)) {
$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');
$result = db_query('SELECT t.tid, COUNT(DISTINCT(n.nid)) AS c FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid '. node_access_join_sql() .' WHERE n.status = 1 AND '. node_access_where_sql() .'GROUP BY t.tid');
}
else {
$result = db_query("SELECT t.tid, COUNT(DISTINCT(n.nid)) AS c FROM {term_node} t, {node} n ". node_access_join_sql() ." WHERE t.nid = n.nid AND n.status = 1 AND n.type = '%s' AND ". node_access_where_sql() ." GROUP BY t.tid", $type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment