- Patch #10718 by drumm: bugfix: it was possible to save a user with no roles assigned when the form clearly said at least one was required.
results in a unclear situation.

Now it is not possible to create a new user as admin by hand.
I get the error message "You must select at least one role." But the form gives no possibility to do that (or i missed a necessary setting).

CommentFileSizeAuthor
#4 user.module_3.diff2.99 KBdrumm
#2 user.module_2.diff1.75 KBdrumm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

I think it would be usefull to add the ability to assign roles into the admin user creation form.

drumm’s picture

Title: user.module 1.385 » Cannot create the first account
Assigned: Unassigned » drumm
Priority: Normal » Critical
FileSize
1.75 KB

Yeah, I made a little mess there. Sorry. Here is a patch to clean that up.

Steven’s picture

Applied to HEAD.

drumm’s picture

FileSize
2.99 KB

This rolls back the first patch in favor of a much better approach. Only validate if the user saw the roles checkboxes (has administer users permission). This solves a few more cases that were broken. The one outstanding case was privileged users creating accounts which means they have administer users permission but were not presented checkboxes for roles. Sorry for the sloppy coding the first time around, I think I tested all the cases this time.

univie’s picture

Is this fixed? I think it works but
with subscription module enabled the following problem occur with user.module 1386
and also using user.module_3.diff
If I create a new user account I get this error messages, but the user is created

user error: Duplicate entry '' for key 2
query: INSERT INTO users (created, changed, uid, data) VALUES ('1094970255', '1094970255', '481', 'a:1:{s:23:\"subscriptions_subscribe\";s:1:\"0\";}') in /usr/local/www/html/drupal-cvs248/includes/database.mysql.inc on line 125.
warning: Invalid argument supplied for foreach() in /usr/local/www/html/drupal-cvs248/modules/user.module on line 147.
user error: Duplicate entry '' for key 2
query: INSERT INTO users (created, changed, uid, data) VALUES ('1094970255', '1094970255', '482', 'a:1:{s:5:\"roles\";a:2:{i:0;i:1;i:1;s:1:\"4\";}}') in /usr/local/www/html/drupal-cvs248/includes/database.mysql.inc on line 125.
user error: Duplicate entry '' for key 2
query: INSERT INTO users (created, changed, uid, data) VALUES ('1094970255', '1094970255', '483', 'a:1:{s:5:\"roles\";a:2:{i:0;i:1;i:1;s:1:\"4\";}}') in /usr/local/www/html/drupal-cvs248/includes/database.mysql.inc on line 125.
user error: Duplicate entry '' for key 2
query: INSERT INTO users (created, changed, uid, data) VALUES ('1094970255', '1094970255', '484', 'a:1:{s:5:\"roles\";a:2:{i:0;i:1;i:1;s:1:\"4\";}}') in /usr/local/www/html/drupal-cvs248/includes/database.mysql.inc on line 125.
user error: Duplicate entry '' for key 2
query: INSERT INTO users (created, changed, uid, data) VALUES ('1094970255', '1094970255', '485', 'a:1:{s:5:\"roles\";a:2:{i:0;i:1;i:1;s:1:\"4\";}}') in /usr/local/www/html/drupal-cvs248/includes/database.mysql.inc on line 125.
user error: Duplicate entry '' for key 2
query: INSERT INTO users (created, changed, uid, data) VALUES ('1094970255', '1094970255', '486', 'a:1:{s:5:\"roles\";a:2:{i:0;i:1;i:1;s:1:\"4\";}}') in /usr/local/www/html/drupal-cvs248/includes/database.mysql.inc on line 125.
..
..
..
..
list goes on
drumm’s picture

Update #5 appears to be an unreleated problem, please file a separate bug report.

drumm’s picture

Looks like this was commited to Drupal CVS with a small code style fix.

Anonymous’s picture