Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After enabling autoassignrole module, i set some roles for users to choose, and make it required.
Then i create a user from backend, found there're two forms for selecting roles, this may cause conflicts.
Comment | File | Size | Author |
---|---|---|---|
#5 | autoassignrole-n1529314-5.patch | 709 bytes | DamienMcKenna |
#2 | autoassignrole_hide_user_choice_fieldset-1529314-2.patch | 709 bytes | anzi31 |
#1 | AutoAssignRole.pdf | 108.82 KB | anzi31 |
Comments
Comment #1
anzi31 CreditAttribution: anzi31 commentedThis occurs only if you have both Automatic and User Choice enabled.
Comment #2
anzi31 CreditAttribution: anzi31 commentedWhen a user with a role that has the "Administer users" permission visits the admin/people/create, and the "user role assignment" is enabled, then the "user choice" fieldset should be hidden to avoid confusion.
Possible patch:
a. In autoassignrole.module, change:
function autoassignrole_form_user_register_form_alter(&$form, &$form_state) {
if (variable_get("autoassignrole_user_active", 0)) {
to
function autoassignrole_form_user_register_form_alter(&$form, &$form_state) {
if (variable_get("autoassignrole_user_active", 0) && !user_access('Administer users')) {
Comment #3
amitgoyal CreditAttribution: amitgoyal commentedLooks good to me!
Comment #4
drumm"administer users"
should not be capitalized.Comment #5
DamienMcKennaThis fixes the issue drumm mentioned in #4.
Comment #6
DamienMcKennaCommitted.
Comment #7
DamienMcKennaClosing this to clean up the issue queue as 7.x-1.0-beta1 was released.