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

drumm’s picture

Status: Active » Postponed (maintainer needs more info)

This is probably caused by a contributed module. What modules are you running and are they compatible with Drupal 5.0?

dharvey’s picture

Hello,

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

dharvey’s picture

As I was going to say all modules are compatible with drupal 5.0 (they are marked 5.0.x.x.dev.

David Harvey

drumm’s picture

The 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.

dharvey’s picture

Hello,

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

ewhipple’s picture

My 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.

flanderz’s picture

I'm getting this error simply by calling user_load from my module. That's pretty unexpected.

yched’s picture

Then you probably have to ask whether the arguments of your user_load() call are valid.

flanderz’s picture

Yes I just figured this out.

Problem was I had

$account = user_load($uid);

Instead of

$account = user_load(array('uid' => $uid));

RobRoy’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Closed (fixed)

Closed then.