the following query has a INNER JOIN broken syntax

    $result = pager_query('SELECT DISTINCT(n.nid), n.title, n.body, n.uid, u.name FROM {node} n '. node_access_join_sql(). ' INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {og} ON n.nid = og.nid WHERE '. node_access_where_sql(). " AND og.selective = 0 AND n.status=1 AND n.type = 'og' ORDER BY n.nid DESC",50);

you forgot to add 'og' after INNER JOIN {og}

here's the corrected sql:

    $result = pager_query('SELECT DISTINCT(n.nid), n.title, n.body, n.uid, u.name FROM {node} n '. node_access_join_sql(). ' INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {og} og ON n.nid = og.nid WHERE '. node_access_where_sql(). " AND og.selective = 0 AND n.status=1 AND n.type = 'og' ORDER BY n.nid DESC",50);

this issue is found in the CVS files.

Comments

moshe weitzman’s picture

fixed as of today ... thanks for the report.

Anonymous’s picture