Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
warning: Invalid argument supplied for foreach() in /usr/local/www/asylum/sites/all/modules/panels/content_types/user_profile.inc on line 32.
I am getting this error whenever I go to any other users profile, when a user goes to their own profile this error does not show up. I am using this in connection with advanced profile kit on drupal 6.8. I am not a PHP developer so I am not sure what line 32 is really talking about or how to resolve this problem.
Comments
Comment #1
raulreynoso CreditAttribution: raulreynoso commentedI'm getting the same error. Are you using the Friendlist module? I added the following code just above line 32:
if ($module = 'friendlist_ui') {break;};
so it skips the problematic code for the fiendlist module. I have no idea why this happens, of if adding this code will cause bigger problems elsewhere, but for now it works.
Comment #2
wickedradio CreditAttribution: wickedradio commentedOk I added your code on line 31 and that solved the error problem but now when I load a user profile the actual user profile pane does not show up. Is that related with this fix or is that something else. I will paste my code block for this.
// 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 ($module = 'friendlist_ui') {break;};
foreach ($items as $key => $item) {
$item['class'] = "$module-". $item['class'];
$fields[$category][$key] = $item;
}
}
}
}
Or perhaps if i remove the friendlist module this might be resolved? I am using several buddy list type modules looking for just the right solution.
Comment #3
wickedradio CreditAttribution: wickedradio commentedJust a note to my previous comment post. I had forgotten to check the box under my profile content type to use it as the user profile. Once I went back in and checked that box the user profile pane showed up as normal. So anyone else having issues with this pay close attention to that detail. I know when spending large amounts of time on getting modules to work, spanning over a day or two or more, one might tend to forget a setting here and there. Again thanks for this wonderful module it has been the best thing for my site.
Comment #4
raulreynoso CreditAttribution: raulreynoso commentedThe profile pane did show up for me. I did have the user profile box checked the whole time. Just curious what your final configuration was. Did you check the box then take out the extra code? Or do you have both the code and the box checked? I'm wondering if the whole problem was caused by not checking the box, if so I may be experiencing some other problem.
Comment #5
wickedradio CreditAttribution: wickedradio commentedno the problem is not caused by the code and uncheck alone. right now i removed the friendlist module and now I am having all sorts of issues. Like right now with the code you gave me and the box checked and no friendlist module the user profiles do not show up, the part that is editable by users. but I am also not getting a warning with it. SO I have no idea what caused this now.
Comment #6
kenorb CreditAttribution: kenorb commentedThe same problem:
on Profile page (panel).
Maybe because this content type doesn't exist?
What the name of content type that should exist, if there is any?
Marked #359139: Error when accessing profiles other than logged in user. as duplicate.
Comment #7
webthingee CreditAttribution: webthingee commentedI am using Flag and Flag Friend and getting the same issues with Panels.
Comment #8
movieguyjon CreditAttribution: movieguyjon commentedI'm having the same problem with my site and the fix outlined in the first comment or two got rid of the red error boxes, but it also got rid of the profile information of each user. I'm not entirely sure what the problem is, so looking for a fix has been difficult.
Comment #9
acossta CreditAttribution: acossta commentedIm having the same problem, can´t find the fix yet.
Comment #10
kev52 CreditAttribution: kev52 commentedI also have this problem!!!
Comment #11
nsciaccabump this thread up --- this is still an issue --- the problem was just in the block that returns the content profile. There still seems to be an issue with viewing someone else's profile when you are already logged in. Anonymous users do not have this issue when viewing other user nodes.
Comment #12
Valeratal CreditAttribution: Valeratal commentedI also have this problem!!!
Comment #13
apadernoComment #14
esmerel CreditAttribution: esmerel commentedThe panels 2 line is deprecated - if this is still an issue in Panels 3, please open a new issue.