Anonymous users on Drupal receive this error when using OG Forums. There are public and OG forums on the site but anonymous users receive this on the public forums as well.

user 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 'SELECT x.tid FROM (SELECT ogt.tid FROM pit_og_term ogt INNER JO query: SELECT DISTINCT(t.tid), t.*, parent FROM pit_term_data t INNER JOIN pit_term_hierarchy h ON t.tid = h.tid WHERE (t.tid NOT IN (SELECT x.tid FROM (SELECT ogt.tid FROM pit_og_term ogt INNER JOIN pit_og_uid ogu ON ogt.nid = ogu.nid AND ogu.uid != 0) x WHERE x.tid NOT IN (SELECT ogt.tid FROM pit_og_term ogt INNER JOIN pit_og_uid ogu ON ogt.nid = ogu.nid AND ogu.uid = 0)) AND t.tid NOT IN (SELECT ogt.tid FROM pit_og_term ogt INNER JOIN pit_og_uid ogu ON ogt.nid = ogu.nid AND ogu.uid = 0 WHERE ogu.is_active = 0)) AND ( t.vid = 3 ) ORDER BY weight, name in /htdocs/drupal/includes/database.mysql.inc on line 172.

If I turn the OG Forum module off, this issue disappears.

Comments

rconstantine’s picture

Hmm, seems I overlooked the anonymous case. They should not be able to go to group forums, but I think there's another issue open regarding that. I'll be taking care of the remaining issues in the next couple of weeks.

Anyway, this is on the list of things to do. Good catch. I'll add a check for user ID and change the query if UID==0.

shane birley’s picture

Thanks! If you require any further testing/help, let me know.

rconstantine’s picture

Assigned: Unassigned » rconstantine
Status: Active » Fixed

OK, I am finally getting around to finishing the official release.

Just took care of this. Anonymous users now see the site-wide forums and can post (remember to not include forum posts in audience targeting).

Even if they enter a group forum post URL directly, they cannot see it.

Anonymous’s picture

Status: Fixed » Closed (fixed)