When a user looks at his/her own profile it is fine. But whenever a user looks at other profiles a php error comes up. I do have profileplus search module, organic groups and fckeditor. But nothing else too complicated. Does not fix when I disable these modules. The error is pasted below with the related code. Any suggestions appreciated.

warning: Invalid argument supplied for foreach() in /home/admin/public_html/modules/user/user.module on line 1519.

The code around there reads:
function user_view($uid = 0) {
global $user;

$account = user_load(array('uid' => $uid));
if ($account === FALSE || ($account->access == 0 && !user_access('administer users'))) {
return drupal_not_found();
}
// Retrieve and merge all profile fields:
$fields = array();
foreach (module_list() as $module) {
if ($data = module_invoke($module, 'user', 'view', '', $account)) {
foreach ($data as $category => $items) {
foreach ($items as $key => $item) {
$item['class'] = "$module-". $item['class'];
$fields[$category][$key] = $item;
}
}
}
}

Comments

rick hood’s picture

I am just running into the same problem. But for me it occurs when I uncheck 'Flag users' in the Flag Content module settings, which I am using. This probably doesn't help but thought I would mention it as I look for an answer too.