Thanks for your work on og_user_roles!

I use og_user_roles in conjuction with the CAS module. I have the CAS module set to "automatically create Drupal accounts" (admin/user/cas > User Account Settings). The very first time a user was authenticating at the CAS server an getting bounced back to drupal I was seeing this error (Note line numbers may be off...):

warning: array-keys() [function.array-keys]: The first argument should be an array in C:\wamp\www\drupal-5
\modules\user\user.module on line 378.
warning: array-fill() Ifunction.array-fill): Number of elements must be positive in C:\wamp\www\drupal-5
\modules\user\user.module on line 379.
wamning: implode() [function implode]: Invalid arguments passed in C:\wamp\www\drupal-5
\modules\user\user.module on line 379.
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.permm) FRoM role r INNER JoIN
permission p ON p.rid = r.rid WHERE r.rid IN 1) in C:\wamp\www\drupal-5\indudes\database.mysql.inc on line 172.

I finally tracked this down to og_user_roles_db_rewrite_sql(). I do not have Taxonomy Access Control enabled. A call here to user_access() seems to be happening just after the user arrives back from the CAS server and user_access sees a user object with no roles for a brief instant which results in the above warning.

My patch below makes a small change to the boolean logic. By testing if the module is installed first user_access() doesn't get called if module_exists() returns false. If Taxonomy Access Control is installed the call to user_access('administer taxonomy') does not result in an error for me.

CommentFileSizeAuthor
#1 og_user_roles.module-300784.patch643 bytesbwood

Comments

bwood’s picture

StatusFileSize
new643 bytes
somebodysysop’s picture

Status: Needs review » Patch (to be ported)

Seems like a reasonable enough request. Will be included in next release.

somebodysysop’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.