I have the latest CVS version of og and og-related modules and the latest CVS versions of Drupal.

When a user who is a member of a group clicks the 'email subscription' link in the Group notifications block, they receive the following MySQL errors:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT COUNT(*) FROM og og INNER JOIN node n ON og.nid = n.nid INNER JOIN node_revisions r ON r.vid = n.vid INNER JOIN users u ON n.uid = u.uid INNER JOIN og_uid ou ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = og.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all'))) AND og.nid IN () in /var/www/includes/database.mysql.inc on line 120

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY n.nid DESC LIMIT 0, 50' at line 1 query: SELECT DISTINCT(og.nid), n.title, r.body, n.uid, u.name, og.description FROM og og INNER JOIN node n ON og.nid = n.nid INNER JOIN node_revisions r ON r.vid = n.vid INNER JOIN users u ON n.uid = u.uid INNER JOIN og_uid ou ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = og.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all'))) AND og.nid IN () ORDER BY n.nid DESC LIMIT 0, 50 in /var/www/includes/database.mysql.inc on line 120

There are no other node access modules installed - I did have TAC installed but no longer need it due to the increasing functionality available in og and have removed it, reset the node_access table and reinstalled og.

This error continues to appear.

Any ideas anyone?

CommentFileSizeAuthor
#5 og_13.patch1.26 KBbwynants

Comments

SavoryMedia’s picture

My partner just got the exact same bug...and my site is supposed to go into private beta tomorrow. *bangs head on desk*

FYI: Drupal 4.7 running OG 4.7 on Dreamhost with PHP 5.1.2 and MySQL 5.0.18 (I think)...and I'm not using any other access modules, either.

Patrick Nelson’s picture

@SavoryMedia -> I'm checking the collation of MySQL tables because I'm getting a number of MySQL errors. Just to compare notes, are all your tables collated for UTF8?

SavoryMedia’s picture

Most of my tables are set to "utf8_general_ci" while a few others (view_breadcrumb, aggregator2_feed, aggregator2_item, legal_accepted, legal_conditions...as well as the SUM row at the bottom of the tables list) are all "latin1_swedish_ci".

I'm a MySQL n00b...I know enough to be really dangerous...so I may not be of much help. *L*

cczernia’s picture

I'm having the same problem. However, I noticed that when I'm logged in as admin it works fine.

bwynants’s picture

Status: Active » Needs review
StatusFileSize
new1.26 KB

this should fix it....

Patrick Nelson’s picture

Bert,

Thanks - that fixed it perfectly.

IMO, this needs to be committed to CVS.

Regards

Patrick

Steve Dondley’s picture

Patch worked for me, too.

But actually, the if statement start just before the

if (!$uid) {

line a few lines before. This error occurs for anonymous users, too.

moshe weitzman’s picture

Status: Needs review » Closed (fixed)

this has all changed in HEAD. please retest there and reopen if needed .. there doesn't seem to be much recent interest in this issue anyway.