[drupal-devel] Project module
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
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
But it seems that the result should really be the following? (difference in the COUNT DISTINCT):
Yes, it should be. It seems module authors made scenarios I did never dreamed of. I presumed that if someone has a field which stores a node id, it is called nid. I do not know project.module, but from this query I suspect that pid stores a node id ('cos the join using it so). On the other hand, we have something else which IS called nid. This won't work. Really won't. Look at node_db_rewrite_sql it checks for primary field being called nid. If someone would enlighten me what is stored in 'pid' and 'nid' , I would happy to assist in patching project.module Regards Karoly Negyesi
Op maandag 14 maart 2005 12:03, schreef Claus Rasmussen:
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?
You should best insert Bugs and issues on drupal.org about this. There they will get noticed. The mailing list is menat for discussions rather than bugs. Please search first if the bug is not already submuitted. Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
participants (3)
-
Bèr Kessels -
Claus Rasmussen -
Negyesi Karoly