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.
The site admin doesn't see this error. It comes up for anonymous and authenticated users on the Ubercart checkout screen:
warning: key_exists() [function.key-exists]: The second argument should be either an array or an object in /home/content/b/r/o/brooklynnet/html/musictutor/sites/all/modules/user_badges/user_badges.module on line 272.
Using Drupal 6.24, Ubercart 6.x-2.7
Comment | File | Size | Author |
---|---|---|---|
#2 | roles_error_test-1463102.patch | 508 bytes | ao5357 |
Comments
Comment #1
ryank76 CreditAttribution: ryank76 commentedStill getting this error, does anyone have any help or ideas?
Comment #2
ao5357 CreditAttribution: ao5357 commentedAttached is a patch file to apply a test for your particular condition. It checks to see if the $roles variable is an array. If it isn't, it sets it as an empty array. Please reply as to whether this makes the error go away or not.
This patch is a one-line change, so you could just paste:
right below line 263 in user_badges.module
Comment #3
ryank76 CreditAttribution: ryank76 commentedHi, thanks for posting the patch. Unfortunately the error is still the same.
Comment #4
ryank76 CreditAttribution: ryank76 commentedI've updated to the latest dev version, still getting the error. Also tested the patch above, still getting the error.
Comment #5
ao5357 CreditAttribution: ao5357 commentedI think this is related to the unfixed error #964546: $account->badges_all issue.
Since setting $roles to an array doesn't make the error go away, that means $account->badges_all is the likely culprit.
A temporary fix would be:
…but the real solution would be to get the previously mentioned error fixed throughout the module.
Comment #6
Simon Georges CreditAttribution: Simon Georges commentedChanging status, as there is a patch.
Comment #7
shabana.navas CreditAttribution: shabana.navas commentedPlease upgrade to the latest dev version and re-open the issue if you are still getting the problem.