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

salvis’s picture

I don't understand why the += didn't work for you. What's your PHP version?

Actually, this is enough:

function _forum_access_get_roles($user) {
  return implode(', ', array_keys($user->roles));
}

Committed to the -dev version. Thanks!

salvis’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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