When users try to reset their password, the recieve an email with a "single use" link. Following this link, they are presented with these errors:

warning: array_keys(): The first argument should be an array in /hsphere/local/home/oldrup/friskole.oldrup.dk/modules/user.module on line 349. 
warning: implode(): Bad arguments. in /hsphere/local/home/oldrup/friskole.oldrup.dk/modules/user.module on line 349. 
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 DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /hsphere/local/home/oldrup/friskole.oldrup.dk/includes/database.mysql.inc on line 120. 

Clicking the login button, this error is shown:

warning: array_keys(): The first argument should be an array in /hsphere/local/home/oldrup/friskole.oldrup.dk/modules/user.module on line 349. 
warning: implode(): Bad arguments. in /hsphere/local/home/oldrup/friskole.oldrup.dk/modules/user.module on line 349. 
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 DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /hsphere/local/home/oldrup/friskole.oldrup.dk/includes/database.mysql.inc on line 120. 

Nevertheless, it seems that users are able to change their passwords regardless of the errors.

I can upload logs and techical should it be helpful.

Regards
Bjarne

Comments

ajk’s picture

Category: bug » support

Failed to reproduce this in DRUPAL-4-7 or HEAD. This issue's "version" is 4.7.3, however, the error message

warning: array_keys(): The first argument should be an array in /hsphere/local/home/oldrup/friskole.oldrup.dk/modules/user.module on line 349.

identifies line 349 as having an array_keys() problem. In the 4.7.3 there is no array_keys() function near line 349 but there is one at line 351 (2 lines later). So, it seems you have a file version mis-match maybe?

What file version (in the $Id: tag at the beginning of the file?) do you have for user.module?

Also, I believe I've seen this issue before and it had something to do with the control panel module being installed (can't remember if it was that module but I think it was, can't find the issue now).

Changing this to "support request" until we know the file version and what modules are installed.

netbjarne’s picture

Thanks for looking into this Ajk

I have a testsite (sandbox.oldrup.dk) where I were unable to reproduce the error.. The version of the user module on this site was:
// $Id: user.module,v 1.612.2.16 2006/08/02 18:13:27 killes Exp $

The version of the user module on the site with problems was:
// $Id: user.module,v 1.612.2.10 2006/05/23 09:39:47 killes Exp $

So I figured that something had went wrong at some upgrade... Anyway. I downloaded a fresh 4.7.3 distribution, renamed settings.php, uploaded the 4.7.3 files, closely watching that all files got uploaded ok, restored my settings.php file and executed update.php.

At that moment, I was quite sure that I could report problem solved... But it isn't.

I did the same exercise again. Requested a new password, received the mail with the single-use link, clicked the link at got this error:

warning: array_keys(): The first argument should be an array in /hsphere/local/home/oldrup/kegnaes-friskole.dk/modules/user.module on line 351.

warning: implode(): Bad arguments. in /hsphere/local/home/oldrup/kegnaes-friskole.dk/modules/user.module on line 351.

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 DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /hsphere/local/home/oldrup/kegnaes-friskole.dk/includes/database.mysql.inc on line 120.

User.module version and line 351:

// $Id: user.module,v 1.612.2.16 2006/08/02 18:13:27 killes Exp $
$result = db_query("SELECT DISTINCT(p.perm) FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (%s)", implode(',', array_keys($account->roles)));

database.mysql.inc version and line 120

// $Id: database.mysql.inc,v 1.52.2.1 2006/05/24 20:47:13 killes Exp $
trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING);

Modules installed:
image
image_pub
image_assist
news_page
nodewords
pathauto
poormanscron
smtp (not enabled)
tinymce

Any suggestions on how to proceed? I just took this baby live today (www.kegnaes-friskole.dk), and I'm a bit sad that this error exists - it might not be the only one?!

Bjarne

netbjarne’s picture

Status: Active » Closed (fixed)

Not sure what caused this problem, but after re-uploading all core files, truncating the variables table, and reconfiguring the site, its seems to have gone away. Case closed. Thans for your help.

Regards
Bjarne