I found this error messages when anon user try to access some admin page area:

warning: array_keys() [function.array-keys]: The first argument should be an array in user.module on line 502.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM msn_role r INNER JOIN msn_permission p ON p.rid = r.rid WHERE r.rid IN () in user.module on line 502.

I want the error messages disappear. so, i modify user.module on line 501:
from:
if (!isset($perm[$account->uid])) {

to:
if (!isset($perm[$account->uid]) && isset($account->roles)) {

and the error messages will disappear.
Maybe it help others or if anybody have another solution to disappear above error messages, please let me know.

Thanks

Comments

jjmackow’s picture

I had this same issue, that is:
"warning: array_keys() [function.array-keys]: The first argument should be an array in user.module on line [512].
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM msn_role r INNER JOIN msn_permission p ON p.rid = r.rid WHERE r.rid IN () in user.module on line [512]."

and the resolution of altering the user.module file did work, but of course, we shouldn't be editing core, so, is this a bug in core or within the module, and if it's in core, can it be fixed there?

I am using Drupal 6.22 as opposed to the orignal reporter's version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.