Opened 5 years ago
Last modified 2 years ago
#52256 reopened defect (bug)
Default hide password field.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 5.6 |
| Component: | Users | Keywords: | has-patch dev-feedback needs-testing |
| Focuses: | javascript, administration | Cc: |
Description
Generate password not working when the first click on generate password button.
Check different behavior in the below URLs
{siteurl}/wp-admin/user-new.php
{siteurl}/wp-admin/profile.php
{siteurl}/wp-admin/user-edit.php?user_id={user_id}
Check the video for a better understanding.
https://www.loom.com/share/2b91de25ab1447e3bb069738c0d318b8
Attachments (2)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Hello ! I have solved this bug.
To fix this bug paste code below from codesandbox into \wp-admin\js\user-profile.min.js folder
I have added one condition to generatePassword function :
} else if ( ! $pass1.val() || $passwordWrapper.hasClass( 'is-open' ) ) { // zxcvbn loaded before user entered password, or generating new password. let firstPassword = $pass1.data( 'pw' ); if (firstPassword){ $pass1.val(firstPassword); $pass1.data( 'pw',"" ); } $pass1.trigger( 'pwupdate' ); showOrHideWeakPasswordCheckbox();and edited ajax call in $generateButton.on( 'click',... function
wp.ajax.post( 'generate-password' ) .done( function( data ) { console.log(data); $pass1.val( data ); } );Your input tag for password should be like this (Path : \wp-admin\user-new.php) :
If it helps you , please reaply)