Problem/Motivation

Impossible to add a new user

Steps to reproduce

Go to the "Add User" page /admin/people/create and look at the "inspect element" feature of your browser; you will see the following error:

user.theme.js?qmujh1:9 Uncaught TypeError: Cannot read property 'password' of undefined
    at user.theme.js?qmujh1:9
    at user.theme.js?qmujh1:35

This is due to the fact that the "confirm password" and the "password strength" widgets are missing.
This is the missing "password strength" which is producing the error (because the library "user/drupal.user" is loaded without all the html elements)

If I change the administration theme to olivero, the missing widgets are coming back and the error disappears.

Comments

DuneBL created an issue. See original summary.

shailja179’s picture

Hi DuneBL,

Which admin theme you were using before olivero?
Can you provide more detail?

Thanks

DuneBL’s picture

I was using Claro (tested on 9.10 and 9.1.2)

cilefen’s picture

Priority: Critical » Major

Claro is experimental in 9.2.x so I don't think this is critical.

acbramley’s picture

I had the same issue with our custom admin theme that extended Claro.

The issue was that we had

user/drupal.user: claro/form.password-confirm

in the libraries-override key which was copied from Claro pre 9.1.

In this commit that was changed and moved into libraries-extend.

When making the same change in our custom theme the issue was fixed.

jcisio’s picture

Category: Bug report » Support request
Priority: Major » Normal

Per #5 I don't think this is a bug. This is a problem with a custom theme extending core theme. If you are using Gin or Gin based theme, it's has been fixed. If not, you can inspire the fix https://git.drupalcode.org/project/gin/-/commit/3456ca4d5

jcisio’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

davidjguru’s picture

Hi there,
I was working in a Drupal 8 upgrade to Drupal 9 and I had problems rendering the second password field "Confirm Password" in /admin/people/create when creating new users. I'm using a custom theme, extended from Claro 9.2.5.

Following #5 I made the changes and now everything is ok.
You gotta edit your custom_theme.info.yml file and move the user/drupal.user: claro/form.password-confirm pair from the block "libraries-override" to the block "libraries-extend".

So, finally;

libraries-extend:
[...]
  core/drupal.ajax:
    - claro/ajax
  user/drupal.user:
    - claro/form.password-confirm
  views/views.module:
    - claro/views

Clearing cache by $ drush cr and now everything will be fine.

afsch’s picture

I agree solution #9, it works for me too. Thank you @davidjguru.