summaryrefslogtreecommitdiff
path: root/modules/taxonomy.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-05-21 11:35:45 +0000
committerDries Buytaert <dries@buytaert.net>2005-05-21 11:35:45 +0000
commit4bedad588c5330ef0bc6b931c9b29940ac3687e3 (patch)
tree0f1490b978f0259ff9d0e5fa8175cfbb96f0bfed /modules/taxonomy.module
parentcdec2f7e3eb2f64c8d916b1d94f74462603eb884 (diff)
downloadbrdo-4bedad588c5330ef0bc6b931c9b29940ac3687e3.tar.gz
brdo-4bedad588c5330ef0bc6b931c9b29940ac3687e3.tar.bz2
- Patch #22469 by mathias: added missing DISTINCT()s to two SQL queries.
Diffstat (limited to 'modules/taxonomy.module')
-rw-r--r--modules/taxonomy.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index 9b030145c..722638573 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -965,8 +965,8 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p
if ($operator == 'or') {
$str_tids = implode(',', call_user_func_array('array_merge', $descendant_tids));
- $sql = 'SELECT n.nid, n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
- $sql_count = 'SELECT COUNT(n.nid) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';
+ $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
+ $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';
}
else {
$joins = '';