Also in 6.x-1.x-dev as of 2012/10/25
At line 783 the query reads:
$sql = 'SELECT n.nid, n.title, n.type, n.uid, COUNT(tn.tid) as count, ncs.comment_count FROM {node} n INNER JOIN {term_node} tn USING (nid) LEFT JOIN {node_comment_statistics} ncs USING (nid) WHERE '. implode(' AND ', $where) .' GROUP BY n.nid ORDER BY '. implode(', ', $order) .' LIMIT '. $limit;
however, at least in PostgreSQL (but I think also in standard SQL) you cannot use attributes in SELECT clause that are not in GROUP BY clause or used in aggregate functions.
The same apply also to ORDER BY clause, the attributes must be included in GROUP BY clause, if not used in aggregate functions
Thus I obtain the following error
warning: pg_query() [function.pg-query]: Query failed: ERROR: column "n.title" must appear in the GROUP BY clause or be used in an aggregate function
since n.title is the first attribute that does not appear in GROUP BY clause.
I'm providing a patch for this issue.
In my environment it works correctly and I'm tried to copy surrounding coding style, however please test it.
Comment | File | Size | Author |
---|---|---|---|
relatedlinks.module.patch | 1.23 KB | gabrimonfa |