Right now, if any role is selected to be automatically assigned, it gets assigned both when the user registers themselves, and also when the admin is creating the new user.
As a result, there is an inconsistency: the admin's new user form has the list of roles that the admin can select, and there is no warning that extra roles will be added because of this module.
A patch is proposed that adds 2 options on the module functionality: Add the selected roles only on user registration form, or both on user reg. form and on admin user creation.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tbartels’s picture

new version of the admin_default method, the first one has a flaw in the logic due to operation order

mlncn’s picture

Status: Needs review » Needs work

Wow i have been a horrible maintainer. I wish these issues would have shown up in http://drupal.org/project/issues/user (without my leaving a comment like this) and maybe this wouldn't have gone 2 years without my noticing.

The patch looks like it would replace existing default values when an administrator edits a user page. An array_merge() here?

+    $form['account']['roles']['#default_value'] = array(variable_get('registration_role_roles', ''));
DuaelFr’s picture

Status: Needs work » Closed (won't fix)

This version of Registration role is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.

efpapado’s picture

Version: 5.x-1.3 » 8.x-1.x-dev
Issue summary: View changes
Status: Closed (won't fix) » Needs review
FileSize
3.19 KB

Reopening this issue, and proposing a patch that offers this feature for the D8 version of the module.

I also update the description.

karthikeyan-manivasagam’s picture

Status: Needs review » Needs work

Hi efpapado,

Thanks for your contribution, patch should support the Drupal 8 version to commit, variable_get is deprecated in D8.

efpapado’s picture

Status: Needs work » Needs review

Hi efpapado,

Thanks for your contribution, patch should support the Drupal 8 version to commit, variable_get is deprecated in D8.

Hmm, my patch does not use variable_get

karthikeyan-manivasagam’s picture

Status: Needs review » Fixed

Oh Sorry, Fixed, thank you !

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

xxdarii’s picture

Hello. I've tried the patch and it doesn't seem to work. When I've chosen User self registration mode and a preferred rolo, on a new registration it doesn't add the role to new user.