Problem/Motivation

When an administrator user tries to add a new user with this module enabled the user is not created and no error message is displayed.
In otp.module the 'otp_form_user_register_form_alter' is created to add a new submit callback to user register form.
Inside this alter two conditions are checked:
the first one (!$form['administer_users']['#value']) is only true for non admin users, so for these users the extra submit handler is NOT added.
the second one is true for all users so '::save' handler is unset
As a result when an admin user try to create a new user profile there is no save handler in submit proccess

Steps to reproduce

Enable this module
As admin, go to add user page /admin/people/create
Fill fields and click 'Create new account button'
User is not created

Proposed resolution

Remove second condition, when an admin is creating a new user we don't need otp verification

I have no time to test this in a clean drupal installation but in our case simply commenting line 27 in otp.module creation users flow works again.
I'll come back with more test and a proper patch (if needed) when I have time to review in depth.

Comments

JulianVJ created an issue. See original summary.

  • sadashiv committed 4f65b64 on 9.x-1.x
    Issue #3249865: Administrator not able to create accounts
    
sadashiv’s picture

Status: Active » Needs review

Thanks for reporting this issue and sorry for my late reply, have fixed this issue in the latest release at https://www.drupal.org/project/otp/releases/8.x-1.0-beta1

Thanks,
Sadashiv

sadashiv’s picture

Status: Needs review » Fixed

No reply, assuming this is fixed, feel to reopen if you have issue.

Thanks,
Sadashiv.

Status: Fixed » Closed (fixed)

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