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.
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
Comment #2
shailja179 CreditAttribution: shailja179 at Srijan | A Material+ Company for Drupal India Association commentedHi DuneBL,
Which admin theme you were using before olivero?
Can you provide more detail?
Thanks
Comment #3
DuneBLI was using Claro (tested on 9.10 and 9.1.2)
Comment #4
cilefen CreditAttribution: cilefen as a volunteer commentedClaro is experimental in 9.2.x so I don't think this is critical.
Comment #5
acbramley CreditAttribution: acbramley at PreviousNext commentedI had the same issue with our custom admin theme that extended Claro.
The issue was that we had
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.
Comment #6
jcisio CreditAttribution: jcisio at Axess Open Web Services commentedPer #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
Comment #7
jcisio CreditAttribution: jcisio at Axess Open Web Services commentedComment #9
davidjguruHi 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;
Clearing cache by
$ drush cr
and now everything will be fine.Comment #10
afschI agree solution #9, it works for me too. Thank you @davidjguru.