diff --git includes/query.inc includes/query.inc index fcb6317..290e6b2 100644 --- includes/query.inc +++ includes/query.inc @@ -115,8 +115,13 @@ class views_query { * Set the base field to be distinct. */ function set_distinct($value = TRUE) { - if (!(isset($this->no_distinct) && $value)) { - $this->distinct = $value; + // Hack in a check to see if node_access is going to add its own DISTINCT + // and break this query. + // See - http://drupal.org/node/284392 for the core bug. + if (!(isset($this->no_distinct))) { + if ($this->base_table != 'node' || node_access_view_all_nodes()) { + $this->distinct = $value; + } } }