Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
foreach module_list as module
if data is module_invoke module, user, view, , account
---------> foreach data as category is items
foreach items as item
item class is module. item class
fields ategory is item
nadas0mus, could you please try out the latest CVS head and see if the error persists.
If so, the issue is likely what kbahey suggests, namely, that one of the contributed modules is not returning user information in the proper format. Could you disable your contributed modules one by one and report if you find one that seems to trigger this problem?
I had the same problem, and tracked it down to the file.module of the e-commerce module - as soon as I activate it, I get the warning, when I deactivate it it disappears...
Comments
Comment #1
chx commentedhttp://drupal.org/node/45850
Comment #2
Fusion_Sushi commentedI should have provided more information... I'm not sure that this is the same thing:
When accessing index.php?q=user/1
Error:
warning: Invalid argument supplied for foreach() in Drive\Path\www\modules\user.module on line 1317.
I whish I had more information but that's all.. it even happens with a blank user_profile.tpl.php file... so its got to be related to something else.
Comment #3
Fusion_Sushi commentedthis is the problem line
foreach module_list as module
if data is module_invoke module, user, view, , account
---------> foreach data as category is items
foreach items as item
item class is module. item class
fields ategory is item
Comment #4
Fusion_Sushi commentedahh actually its the next one
foreach ($items as $item)
in the user.module
Comment #5
Fusion_Sushi commentedThink this is the problem:
http://drupal.org/node/45444
Comment #6
Fusion_Sushi commentedwarning: Invalid argument supplied for foreach() in Drive\Path\modules\user.module on line 1343.
Comment #7
Fusion_Sushi commentedWell, I'm not sure if its the same problem, might be diffrent. The error is more specific:
// Picture/avatar:
if (variable_get('user_pictures', 0)) {
$form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1);
------------> $picture = theme('user_picture', (object)$edit);
Comment #8
Fusion_Sushi commentedI probably broke it but here is how to get rid of the error:
Find these lines and cut them out of the user.module on or about 1370
foreach ($items as $item) {
$item['class'] = "$module-". $item['class'];
$fields[$category][] = $item;
}
Comment #9
dallasgrant@newswire.ws commentedRemoving the problem line does not work, it is what will display the needed profile information
Comment #10
dallasgrant@newswire.ws commentedThe error is as followed:
warning: Invalid argument supplied for foreach() in /home2/wiredban/public_html/v4/modules/user.module on line 1317.
Line 1317 is:
foreach ($items as $item) {
This problem only happens for me when a user is looking at there own profile ... I don't get it when looking at other people's profiles.
Comment #11
gregglesI tried to repeat this bug with a current CVS-HEAD and could not repeat it.
dallasgrant (or anyone else) - if the problem persists for you please provide concrete steps that will consistently make the problem show up.
Comment #12
kbahey commentedI cannot reproduce this in the current HEAD (checked out in the last half hour).
This line is 1401 in user.module 1.584
Is this because of a contrib module misbehaving and returning data that is not an array?
Comment #13
puregin commentednadas0mus, could you please try out the latest CVS head and see if the error persists.
If so, the issue is likely what kbahey suggests, namely, that one of the contributed modules is not returning user information in the proper format. Could you disable your contributed modules one by one and report if you find one that seems to trigger this problem?
Thanks, Djun
Comment #14
benma commentedI had the same problem, and tracked it down to the file.module of the e-commerce module - as soon as I activate it, I get the warning, when I deactivate it it disappears...