hi,
the original error message I got was like this:
warning: Invalid argument supplied for foreach() in /www/htdocs/w00856ed/drupal/modules/user/user.module on line 1507.
I posted this 'bug' already in the forums - but only received similar problem reports from other people:
http://drupal.org/node/160371
Then I finally found some post with a very similar problem:
http://drupal.org/node/125902
..which led me to solving my own problem:
The problem seems to be that in line 1507 (in function user_view($uid = 0)) the user.module returns an error if the array $items is empty. I 'debugged' this for now by adding an appropriate if-statement there so that it now checks if the array actually contains anything:
// 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) {
if ( is_array($items) ) {
foreach ($items as $key => $item) {
$item['class'] = "$module-". $item['class'];
$fields[$category][$key] = $item;
}
}
}
}
}
I'm actually not realy sure if this is a bug - but now it works - and i don't get any annoying error messages.. Maybe someone else could have a look at it..? Thank you very much!
greetings, till
Comments
Comment #1
dpearcefl commentedConsidering the age of this issue with no responses and that D5 is unsupported, I am closing this issue.