Hi there,

When logged in as administrator I get the following message when trying to look at "my account":

warning: Invalid argument supplied for foreach() in *******/modules/user.module on line 1448.

If I look at somebody else's account who is logged in without administrator permissions this error does not appear...

The following bit of code seems to be the culprit:

1443         // Retrieve and merge all profile fields:
1444         $fields = array();
1445         foreach (module_list() as $module) {
1446            if ($data = module_invoke($module, 'user', 'view', '', $account)) {
1447              foreach ($data as $category => $items) {
1448                 foreach ($items as $item) {
1449                     $item['class'] = "$module-". $item['class'];
1450                     $fields[$category][] = $item;
1451                 }
1452              }
1453            }
1454         }

Does anybody else seem to have this problem, and any fix for it? I have searched the forums and seem to have found nothing...

Thanks in advance for your help

James

Comments

berty_boy’s picture

I know its bad practice to reply to your own post, but after disabling the modules one-by-one it seems to be the invite module thats causing the bother??

pwolanin’s picture

...it's the best possible practice to respond to your own post if you find the answer or have more information.

---
Work: BioRAFT

jlorance’s picture

i'm getting the same error except mine occurs when I have profiles defined in CiviCRM. If I turn CiviCRM off or remove the profile, I'm fine.. still haven't found a solution.

mike4miyu’s picture

I am having the same problem.

I just installed drupal 4.7 then installing civiCRM 1.4.

when viewing my profile I get:

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

also cant register a new user. when i click on register nothing happens.

has anyone found a solution to this?

mike

gnowels’s picture

To confirm the issue.

CivicCRM new install with Drupal 4.7. Create any profile and get the errors.

Invalid argument supplied for foreach() in /hsphere/local/home/*/opere-citato.org/modules/user.module on line 1454.

Trying to register new users getting server error. Also when user tries to edit the profile.

Wow, and look at this...what a surprise. A FastCGI error in Drupal? NOoooo - Yep

FastCGI: incomplete headers (0 bytes) received from server

"God draws straight with crooked lines." Greely

http://www.mycatholicblog.net
http://www.opere-citato.org

rw712’s picture

I also had the same problem. To solve it, and I don't know if this is kosher, but I don't perform that block of code if the module is 'civicrm'. So, the new block of code looks like:

  foreach (module_list() as $module) {
    if ($module != 'civicrm') {
      if ($data = module_invoke($module, 'user', 'view', '', $account)) {
        foreach ($data as $category => $items) {
          foreach ($items as $item) {
            $item['class'] = "$module-". $item['class'];
            $fields[$category][] = $item;
          }
        }
      }
    }
  }