[drupal-devel] [bug] Error while deleting user in drupal

chx drupal-devel at drupal.org
Fri Jan 14 12:38:28 UTC 2005

 Project:      Drupal
 Version:      4.5.1
 Component:    user.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  chx
 Reported by:  gkrishna
 Updated by:   chx
 Status:       patch

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_

I'll try again to reproduce this...


Previous comments:

October 25, 2004 - 18:50 : gkrishna

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


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


October 25, 2004 - 21:34 : killes at www.drop.org

are you running  php 5?


October 26, 2004 - 00:46 : gkrishna



October 26, 2004 - 21:50 : Steven

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.


November 5, 2004 - 17:45 : baudolino

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.


January 12, 2005 - 20:33 : chx

Attachment: http://drupal.org/files/issues/user_delete.patch (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.


January 13, 2005 - 22:37 : Dries

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

View: http://drupal.org/node/12103
Edit: http://drupal.org/project/comments/add/12103

More information about the drupal-devel mailing list