Created a test user account .
After successful testing of the module, when i tried to delete the account from here,

http://example.net/user/4/edit

i got the error,
# warning: array_keys(): The first argument should be an array in /usr/local/apache/htdocs/modules/user.module on line 1006.

I am using drupal 4.5rc

CommentFileSizeAuthor
#5 user_delete.patch874 byteschx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

Priority: Critical » Normal

are you running php 5?

gkrishna’s picture

Priority: Normal » Critical

php-4.3.9

Steven’s picture

It sounds like a problem when no roles are set. This could happen before, through a bug where user roles got lost if the user form didn't validate while editing. But this bug was fixed in 4.5 RC.

It could be that editing the user during 4.5 RC caused the roles to be lost, and that you now have a broken user account, even though this is no longer possible in 4.5 final.

baudolino’s picture

Priority: Critical » Normal

I just got the same error on Drupal 4.5 final. I created a test user, then tried to delete it. It complained first that the user has to be blocked. Fine. I blocked the account, hit delete and then it said "user not found". The account was deleted, however.

The log entry for this event was:
warning: array_keys(): The first argument should be an array in [path-todrupal]\modules\user.module on line 1039.

I was logged in as user #1.

chx’s picture

Assigned: Unassigned » chx
FileSize
874 bytes

I have even encountered this in the CVS version. The sequence of add, block, delete causes this. A very simple fix follows. Will submit as a patch for CVS, too.

Dries’s picture

I can't reproduce this problem with HEAD. All users need to have at least one role. If they don't have at least one role, something else is wrong (which implies this patch fixes the sympthom, not the problem).

chx’s picture

This is strange. I can not reproduce now it either. But I yesterday I could do it with ease, see http://drupal.org/node/15511 , I have submitted the error message straight from the watchdog. So it _did_ happen.

I'll try again to reproduce this...

killes@www.drop.org’s picture

Apparently some form of ghost bug.

Anonymous’s picture