hook_og_user_roles_gid() not working with OG 6.x-2.0

jrb - October 6, 2009 - 20:04
Project:OG User Roles
Version:6.x-1.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

In the 6.x-2.0 release of OG, there was a change in og_init(). Instead of calling the user_load() function (along with other module's implementations of hook_user()), it's now just directly calling its own implementation of hook_user(). In og.module around line 388, this:

<?php
 
if ($user->uid) {
   
$user = user_load(array('uid' => $user->uid));
  }
?>

Was changed to this:

<?php
 
if ($user->uid) {
   
// $user gets modified by reference.
   
og_user('load', array(), $user);
  }
?>

This change appears to prevent implementations of hook_og_user_roles_gid() from working correctly. It does for me, anyway-- users with group permissions are getting "Access Denied" where they shouldn't. If I add a call to either user_load() or og_user_roles_user() directly, it works again:

<?php
 
if ($user->uid) {
   
// $user gets modified by reference.
   
og_user('load', array(), $user);
   
$edit = array();
   
og_user_roles_user('load', $edit, $user);
  }
?>

How can we fix this without editing OG?

Thanks,
JRB

#1

GA - October 9, 2009 - 13:29

subscribing...

#2

sun - December 5, 2009 - 18:01
Status:active» duplicate

Thanks for taking the time to report this issue.

However, marking as duplicate of #528154: og_user_roles doesn't work with OG 6.x-2.x-rc3. Please search for existing issues before submitting a new one.
You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.

 
 

Drupal is a registered trademark of Dries Buytaert.