Closed (fixed)
Project:
Drupal core
Version:
5.0-rc1
Component:
user.module
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2007 at 02:28 UTC
Updated:
20 Mar 2007 at 21:49 UTC
Hello,
After logging into my admin account, the following error comes up:
"warning: Invalid argument supplied for foreach() in /home/d-w-harv/public_html/modules/user/user.module on line 1501."
I'm using Drupal 5.0-RC1 on Apache 1.3 with PHP 4.1.
Thanks
David Harvey
Comments
Comment #1
drummThis is probably caused by a contributed module. What modules are you running and are they compatible with Drupal 5.0?
Comment #2
dharvey commentedHello,
I've installed several contributed modules, but the error reported is in the user.module, as shown when I log into my account.
David Harvey
Comment #3
dharvey commentedAs I was going to say all modules are compatible with drupal 5.0 (they are marked 5.0.x.x.dev.
David Harvey
Comment #4
drummThe line of code you mentioned is the user module processing some data retrieved from modules. That data is apparently in the wrong structure. Disabling modules will probably remove the error message when the module(s) causing the bug is disabled.
Comment #5
dharvey commentedHello,
So shall I disable some modules to see if the problem goes away?
Also is the error fixed in CVS or is their a pach available?
Thanks
david Harvey
Comment #6
ewhipple commentedMy site had the same symptoms. Line 1501 in user.module is a foreach() operating on the results of a call to hook_user() via module_invoke(). In my case, the error was in reports.module. If I disable that module, or edit it to correct the function, the problem goes away.
See http://drupal.org/node/107207 for more details.
Comment #7
flanderz commentedI'm getting this error simply by calling user_load from my module. That's pretty unexpected.
Comment #8
yched commentedThen you probably have to ask whether the arguments of your user_load() call are valid.
Comment #9
flanderz commentedYes I just figured this out.
Problem was I had
$account = user_load($uid);Instead of
$account = user_load(array('uid' => $uid));Comment #10
RobRoy commentedClosed then.