[wp-trac] [WordPress Trac] #52086: user-profile.min.js issue on Firefox

WordPress Trac noreply at wordpress.org
Thu Dec 31 03:41:09 UTC 2020


#52086: user-profile.min.js issue on Firefox
--------------------------+-------------------------
 Reporter:  adi64bit      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.6.1
Component:  Users         |     Version:  5.6
 Severity:  critical      |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+-------------------------

Comment (by sbossarte):

 I am experiencing the same here on a fresh install of WordPress, though it
 seems more of a race condition, as it will sometimes error out, and
 sometimes work just fine.

 I don't want to assume too much, but from what I see here it looks like
 this happens because in `user-profile.js`, `generatePassword()` looks for
 the `$toggleButton` before it has been set with `bindToggleButton()`. This
 seems to be because of zxcvbn being loaded fast enough, otherwise the
 `generatePassword` gets held off until later with a timeout as seen here:

 {{{
 if ( typeof zxcvbn !== 'function' ) {
         setTimeout( generatePassword, 50 );
         return;
 }
 }}}

 if `bindToggleButton()` is bumped up higher in `bindPasswordForm()`,
 before `bindPass1` can be called, it seems like this might fix the issue.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52086#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list