OG ROLES module error on page "configure member roles"

user warning: Unknown table 'n' in on clause query: SELECT COUNT(*) FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.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') OR (na.gid = 18 AND na.realm = 'og_subscriber'))) AND ou.nid = 18 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
user warning: Unknown table 'n' in on clause query: SELECT u.uid, u.name, u.mail, u.picture, ou.* FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.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') OR (na.gid = 18 AND na.realm = 'og_subscriber'))) AND ou.nid = 18 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 ORDER BY u.name ASC LIMIT 0, 100 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
warning: Invalid argument supplied for foreach() in /home/smilodon/public_html/portaal7/modules/og/contrib/og_roles/og_roles.module on line 195.

I have no ide what this means.

Comments

webchick’s picture

Hm. I can't duplicate this here.

And you get this on no other page? And if you disable the og roles module it goes away? If just og and og roles are enabled, and no other contribs, do you still get this error? What version of PHP/MySQL are you using?

og roles doesn't seem to do either of these queries so I'm wondering where it's coming from.

smilodon’s picture

MySQL is 4 something
PHP Version 4.4.1

I disabled all other modules (not taxonomy, forum, content)and then i enabled og and og.roles...

?q=admin/settings/og_roles is displayng:
warning: Invalid argument supplied for foreach() in /home/smilodon/public_html/portaal7/modules/og/contrib/og_roles/og_roles.module on line 81.

This is a new error, it was not there, so i think i shouldnt have disabled the modules.
The link to page "configure member roles" is not there anymore.

smilodon’s picture

Sorry, my bad, i didnt enable the basic og module...
After doing so, i got rid of the error i last mentioned...
And the first error as well... i enabled other modules 1 by 1... and didnt manage to get the first error again... weird !

webchick’s picture

So.. it's fixed...?

webchick’s picture

Status: Active » Fixed

K, marking fixed. Please feel free to re-open with more info if you are still experiencing this problem.

smilodon’s picture

Status: Fixed » Active

Ooo i refreshed all the og module files, i now have all my modules enabled and i got this:

user warning: Unknown table 'n' in on clause query: SELECT COUNT(*) FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = -1 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all') OR (na.gid = 18 AND na.realm = 'og_subscriber') OR (na.gid = 26 AND na.realm = 'og_subscriber') OR (na.gid = 0 AND na.realm = 'tac_lite'))) AND ou.nid = 26 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
user warning: Unknown table 'n' in on clause query: SELECT u.uid, u.name, u.mail, u.picture, ou.* FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = -1 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all') OR (na.gid = 18 AND na.realm = 'og_subscriber') OR (na.gid = 26 AND na.realm = 'og_subscriber') OR (na.gid = 0 AND na.realm = 'tac_lite'))) AND ou.nid = 26 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 ORDER BY u.name ASC LIMIT 0, 100 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
warning: Invalid argument supplied for foreach() in /home/smilodon/public_html/portaal7/modules/og/contrib/og_roles/og_roles.module on line 148.
user warning: Unknown table 'n' in on clause query: SELECT COUNT(*) FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = -1 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all') OR (na.gid = 18 AND na.realm = 'og_subscriber') OR (na.gid = 26 AND na.realm = 'og_subscriber') OR (na.gid = 0 AND na.realm = 'tac_lite'))) AND ou.nid = 26 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
user warning: Unknown table 'n' in on clause query: SELECT u.uid, u.name, u.mail, u.picture, ou.* FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = -1 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all') OR (na.gid = 18 AND na.realm = 'og_subscriber') OR (na.gid = 26 AND na.realm = 'og_subscriber') OR (na.gid = 0 AND na.realm = 'tac_lite'))) AND ou.nid = 26 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 ORDER BY u.name ASC LIMIT 0, 100 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
warning: Invalid argument supplied for foreach() in /home/smilodon/public_html/portaal7/modules/og/contrib/og_roles/og_roles.module on line 195.

So wtf is it ? I discovered, that it does not happen to the OG admin... the one who can administer groups etc. It happens to the group owner, the user who created the group and wants to access "configure member roles". Eaeven after disabling all the other modules i have, the group owner still had this error.

smilodon’s picture

Ok going to test it meanly. I droped all drupal 4.7 tables. Created new ones, made admin account. Ok now enabled og, og_basic, og_block, og_block_visibility, og_roles. At settings enabling the og access thingy. Created 2 roles. And under roles settings i put them to "assignable roles".

Creating a new test account (not admin) and giving "create groups" permission to authenticated users. Enabling all the group related blocks. And logging in with test account. Ok now creating one group and going to look "1 subscriber" subscribers.

Now pressing button "configure member roles" and what do i see ?

user warning: Unknown table 'n' in on clause query: SELECT COUNT(*) FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.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') OR (na.gid = 1 AND na.realm = 'og_subscriber'))) AND ou.nid = 1 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
user warning: Unknown table 'n' in on clause query: SELECT u.uid, u.name, u.mail, u.picture, ou.* FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid INNER JOIN node_access na ON na.nid = n.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') OR (na.gid = 1 AND na.realm = 'og_subscriber'))) AND ou.nid = 1 AND u.status > 0 AND is_active >= 0 AND is_admin >= 0 ORDER BY u.name ASC LIMIT 0, 100 in /home/smilodon/public_html/portaal7/includes/database.mysql.inc on line 120.
warning: Invalid argument supplied for foreach() in /home/smilodon/public_html/portaal7/modules/og/contrib/og_roles/og_roles.module on line 195.

This should be fixed, i have no idea where this error might have come.

webchick’s picture

Status: Active » Fixed

Awesome, thanks for the detailed bug report. This has now been fixed in both HEAD and 4.7.

smilodon’s picture

Good to hear that i could be helpful :)

webchick’s picture

Project: Organic Groups » OG Forum
Component: og.module » Code
webchick’s picture

Project: OG Forum » OG Roles
Anonymous’s picture

Status: Fixed » Closed (fixed)