By Laurentvw on
I got the following warning when accessing ANY user profile:
warning: Invalid argument supplied for foreach() in C:\apache2triad\htdocs\modules\user\user.module on line 1516.
Note that it does not appear when accessing MY own profile (when I'm logged in). Very weird.. What's wrong?
Thanks in advance.
Comments
modifying user view modules..
the lines 151x in the user module are about the hook_view for the user module itselfs, and this hook has only to main code blocks:
the first, cares about the user information, to be shown in the user view.. the problem is regarding with categories of the user information.. any module with the user view hook may be returning wrong information. Check wich modules are modifying the user view (you should know as you are looking the user profiles to see something that should appear there and only you know what it is).
If this has nothing to do with your set up, than the problem should be in the second code block of this hook.. the hook_profile_alter.. Check the list of modules you are using (try disabling some to see if problem disappears) to detect which is the module returning
Next time try a more verbose post about the modules you are using, and when the problem appears, example.. when you enable wich modules..
(no title)
Hey there!
Thanks a lot for your help again. I tried disabling modules and came to the conclusion that "Flag content" is causing the problem.
I looked at the settings in flag content and came across this:
Enable flagging for users and comments
[] Flag users
[] Flag comments
Flag users was not enabled. When I enabled flag users, the error disappeared. So I guess that's where the center of the problem is.
Now I'm not sure what to do. I guess this is a module bug, so I better continue discussing this in the support section of that module?
for sure, you should.
for sure, you should. ;)
Remember to refer this conversation so the mantainer may get better conclusions about the request.
the problem should be what the flag content user view hook returns when not enabled.
Thanks. Done that.
Thanks. Done that.
I get the message in my
I get the message in my error log for invalid argument supplied foreach on line 1507. I don't know if the line 1507 is related to flag content. When I disable flag content, it shows on 1511.
works
Just stumbled across this after doing search on same, and wanted to pass along that above works perfectly (i.e., be sure to visit the "Flag content" module settings and toggle Flag users)... thanx for posting it.
solution / hack / mod
Hi i don't need to flag users .. so here my hack:
flag_content.module
[FIND]
function flag_content_user($op, &$edit, &$account, $category = NULL) {
[... some php ...]
}
[COMENT THIS FUNKTION]
and the red error is gone....