Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 5.0.0
-
Fix Version/s: 5.1.0-b1
-
Component/s: Client Interface, Staff Interface
-
Labels:None
Description
The Generate button works intermittently. Client report with details below:
The bug can been seen in the SolusVM module when generating a password. See the attached screenshot if any further clarification is needed.
Expected Behavior
When the "Generate Password" modal is created, content is loaded from 'client/dialog/password/' which includes a button with classes '.btn.generate'. The content should be loaded before the modal is shown. When the modal is shown, a "click" event handler is added to the button which will generate a random password.
Actual Result
A race condition exists between the modal contents being retrieved via an AJAX request and the click event handler being attached.
Depending on the speed of 'client/dialog/password/', the modal may be shown before the button exists. If this happens, no click event handler is attached to the button and clicking it will do nothing.
Steps to Reproduce
An easy way to reproduce this is to intentionally slow down 'client/dialog/password/' by adding a `sleep(1);` in app/controllers/client_dialog.php to the method ClientDialog::password().