Closed (fixed)
Project:
Forum Access
Version:
5.x-1.10
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2008 at 21:03 UTC
Updated:
21 Sep 2008 at 14:02 UTC
Got the error Fatal error: Unsupported operand types in ...drupal\sites\all\Modules\forum_access\forum_access.module on line 407
have a look in the code and found :
function _forum_access_get_roles($user) {
// if the user has a uid, they get 1 as a role; otherwise 0.
$roles = array(intval((bool) $user->uid) + 1);
// add in their roles
$roles += array_keys($user->roles);
return implode(', ', $roles);
}
patched with
function _forum_access_get_roles($user) {
// if the user has a uid, they get 1 as a role; otherwise 0.
$roles = array(intval((bool) $user->uid) + 1);
// add in their roles
$roles = array_merge($roles,array_keys($user->roles));
return implode(', ', $roles);
}
seem to work well now
Comments
Comment #1
salvisI don't understand why the += didn't work for you. What's your PHP version?
Actually, this is enough:
Committed to the -dev version. Thanks!
Comment #2
salvisComment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.