Drupal 5 clean install, Xampp 1.5.2, Windows XP

With a clean install of Drupal 5 and three contributed modules installed in the following order: 1) modr8 v5.x-2.1; 2) views v5.x-1.5 (required by OG); and 3) OG v5.x-1.0. After activating the Live Discussion Block I receive the following error when logging in and out of user accounts:

Not unique table/alias: 'n' query: SELECT DISTINCT(c.nid), n.title, COUNT(c.nid) AS comment_count, MAX(c.timestamp) AS the_time FROM comments c LEFT JOIN node n ON n.nid = c.nid LEFT JOIN node n ON c.nid = n.nid INNER JOIN node_access na ON na.nid = c.nid WHERE ((n.moderate != 1 OR n.uid = 0)) AND (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public'))) AND ( n.status = 1 AND c.status = 0 ) GROUP BY c.nid ORDER BY the_time DESC LIMIT 10 in C:\Internet\xampp\htdocs\drupal\includes\database.mysql.inc on line 167.

See this related issue also: http://drupal.org/node/111421

Comments

Prometheus6’s picture

Assigned: Unassigned » Prometheus6
Status: Active » Needs review
StatusFileSize
new3.71 KB

The module creates a query on the comment table...when it calls db_rewrite, the module tells db_rewrite the indexed table's alias is 'c'...it looks like someone is hooking into the rewrite chain in some way that assumes the table alias will be 'n'.

At any rate, because of this suggestions
http://drupal.org/node/112429

I've updated the module such that this should go away. It's the HEAD version, and if you can handle diffs I've attached one.

pwolanin’s picture

StatusFileSize
new1.96 KB

today, doing a checkout on the DRUPAL-5 branch, there seemed to have some really wrong queries.

I used the attached patch to get it working (note the change to use db_query_range).

Prometheus6’s picture

Status: Needs review » Closed (fixed)

released the new version