I just turned og_subgroups on and I'm getting SQL errors. It's reproducable and I can't figure out what the problem is. Turning og_subgroups off prevents further SQL errors.

warning: array_keys() [function.array-keys]: The first argument should be an array in /home/fabmin/public_html/modules/user.module on line 351.
warning: implode() [function.implode]: Bad arguments. in /home/fabmin/public_html/modules/user.module on line 351.
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 ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/fabmin/public_html/includes/database.mysql.inc on line 120.

These errors appear when viewing a group's home page (group content type) as an authenticated user who does not belong to the group.

Any ideas about what's going on?

CommentFileSizeAuthor
#8 og_subgroups.module.diff666 bytessmk-ka

Comments

donengel’s picture

I'd like to help. I haven't run into this problem when using the module. Are you using 4.7? Are you using mySQL?

Thanks,
Don

Christefano-oldaccount’s picture

Title: SQL errors when og_subgroups is turned on » Thanks for the help!

Yes, I'm using both 4.7 and MySQL. Any help you could give would be much, much appreciated.

I enabled og_subgroups once again while writing this post and it looks like both user 1 and anonymous visitors get the same errors (and user 1 does belong to the group).

Christefano-oldaccount’s picture

Title: Thanks for the help! » SQL errors when og_subgroups is turned on

Any ideas there, donengel?

Here's my setup:

Drupal
Version	4.7.3
Sites directory	default
Database prefix	

Web Server
Type	Apache
Version	1.3.37
PHP Interface	CGI

PHP
Version	4.4.3
Magic Quotes GPC	On
Magic Quotes Runtime	Off
Memory Limit	
Register Globals	Off
Safe Mode	Off
Session Cache Limiter	none
Session Save Handler	user
Upload Max Filesize	2M
Extensions
CURL Support	Enabled
GD Version	bundled (2.0.28 compatible)
FreeType Support	Enabled
XML Support	Enabled
Zip Support	Enabled
Zlib Support	Enabled

Database
Type	MySQL
Version	4.1.21-standard
Charset	utf8
Collation	utf8_general_ci
Permissions
Create Temporary Tables	Allowed
Lock Tables	Allowed
donengel’s picture

I hope to get the chance to look into this soon - thanks for the reminder and for your interesting in the module.

donengel’s picture

I hope to get the chance to look into this soon - thanks for the reminder and for your interest in the module.

donengel’s picture

I'm still unable to reproduce this error. Based on the SQL error you're receiving, I'm thinking this must have something to do with 'roles' - perhaps another module you have installed is combining role information with group membership information somehow? Does anything like that sound familiar? Do you have other group- or og-related modules installed?

Christefano-oldaccount’s picture

I've checked if this is being caused by the user.module patch I got from http://drupal.org/node/8 (user.module is the only part of core I've modified), but the errors persist even when using a stock user.module.

The only og-related module I'm using (other than og.module itself) is og_calendar. I'll see if I have a module conflict as soon as I can get to a test machine.

Thanks for your help! I'll post again when I've systematically disabled/enabled all of my contrib modules.

smk-ka’s picture

Category: support » bug
Status: Active » Needs review
StatusFileSize
new666 bytes

Looks like a copy'n'paste bug.

--
Stefan Kudwien
www.unleashedmind.com

Christefano-oldaccount’s picture

Thanks, it works.

vikingew’s picture

Status: Needs review » Fixed

not sure as I haven't done this before :-) but I am setting this to fixed as the patch seem to have been committed.

Christefano-oldaccount’s picture

Sounds good. og_subgroups has been working for me since it stopped using taxonomy.

Anonymous’s picture

Status: Fixed » Closed (fixed)