Closed (fixed)
Project:
User Badges
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2011 at 01:16 UTC
Updated:
20 Jun 2013 at 07:33 UTC
Invalid argument supplied for foreach() in /home/oursite/html/sites/all/modules/user_badges/user_badges.module on line 215.
referer: http://www.oursite.com/user/register
We just noticed these popping up in the log files. Does anyone know what may be causing this or how to fix it.
Thanks for any input
Comments
Comment #1
sjorgnsn commentedditto - subscribing and I might look into it myself.
Comment #2
venusrising commented@sjorgnsn
I have been looking but cannot figure out the issue.
Comment #3
BeatleMike commentedI have the same issue, it seems to randomly pop up everywhere, even pages that would never display a badge. It's even more prevalent just after a server reboot.
This revision of the module is from November 2010, perhaps it's an issue with other modules running? Are either of you running userpoints?
Comment #4
tyrusmanuel commentedsubscribing, getting them after a new user registers especially, including as a message on my homepage.
Also getting warning: key_exists() expects parameter 2 to be array, null given in C:\xampp\htdocs\coax\modules\user_badges\user_badges.module on line 244.
Comment #5
tyrusmanuel commentedSee this post also, haven't tested the patches or tested any dev versions yet, but they seem to have fixed this issue and mine as well:
http://drupal.org/node/964546
Comment #6
tyrusmanuel commentedThe dev version fixed the line 215 error for me when a new user registers, I am still having the "key exists" error for line 244 however.
Comment #7
tyrusmanuel commentedNow also seeing this error warning: Illegal offset type in C:\xampp\htdocs\coax\modules\user_badges\user_badges.module on line 275. After changing a users role in the admin interface.
Comment #8
venusrising commentedOkay we too are seeing after someone tries to register. Had a hard time re-creating this but after reading the above code we looked at the logs and is showing being generated on registration.
User Visitor
Location http://www.oursite.com/user/register
Referrer http://www.oursite.com/user/register
Message Invalid argument supplied for foreach() in /home/oursite/html/sites/all/modules/user_badges/user_badges.module on line 215.
Severity error
Comment #9
venusrising commentedI used the patch for the other badges all issue but it does not correct this DB error issue.
Comment #10
boftx commentedSubscribe
Comment #11
jsidigital commentedAnyone find a fix for this yet?
I get it after new users register.
how can we avoid this message?
Thanx.
Comment #12
jsidigital commentedOk. The 215 error i fixed by following this:
http://drupal.org/node/964546#comment-3717306
However, i still cannot find a fix for the 248 error.
warning: key_exists() [function.key-exists]: The second argument should be either an array or an object in /home/jsi/public_html/sites/all/modules/user_badges/user_badges.module on line 248.
Anyone else seeing this after a registration? Do we even know what is causing it?
Comment #13
dunx commentedThe function call should be using array_key_exists, not key_exists. Not that this fixes the issues, but key_exists is deprecated. Other issues may be PHP5.3 related.
Comment #14
shabana.navas commentedFixed in Version 7. Please upgrade to Version 7.x-3.x.