[drupal-devel] Project module
Claus Rasmussen
claus at webclaus.com
Mon Mar 14 11:03:33 UTC 2005
Hi folks,
I'm trying to run the project.module on 4.6RC with PHP5 and MySQL 4.1.
In the function project_page_user a query gets rewritten to:
SELECT DISTINCT(n.nid), n.title, n.changed, COUNT(p.DISTINCT(n.nid)) AS
count FROM node n LEFT JOIN project_issues p ON n.nid = p.pid AND p.state IN
(1,2,8) WHERE n.type = 'project_project' AND n.status = 1 AND n.uid = 1
GROUP BY n.nid ORDER BY n.title ASC
But it seems that the result should really be the following? (difference in
the COUNT DISTINCT):
SELECT DISTINCT(n.nid), n.title, n.changed, COUNT(DISTINCT(p.nid)) AS count
FROM node n LEFT JOIN project_issues p ON n.nid = p.pid AND p.state IN
(1,2,8) WHERE n.type = 'project_project' AND n.status = 1 AND n.uid = 1
GROUP BY n.nid ORDER BY n.title ASC
The module still doesn't quite work (php error log: PHP Fatal error: Cannot
use object of type stdClass as array in /path/to/modules/node.module on line
380, referer: URL/project) but before looking into that, isn't the query
rewrite wrong?
/claus
More information about the drupal-devel
mailing list