[stable10] Backport of Check the retypepassword exist in the dom befo… #34834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The issue here is, the id
retypepassword
is not available during the login. Its only available when the lostpassword.js is loaded from https://github.com/owncloud/core/blob/master/core/templates/lostpassword/resetpassword.php#L36. This issue was found in the console log and not in the UI. So in the lostpassword.js before checking if the idretypepassword
exist, the objects.val().length
was fetched which was throwing error in the web dev console. So in this PR, first we check if the id exist, if so then check the.val().length
equal to zero, to remove the warning class and then empty the message text. ( copied from PR #34816)Related Issue
Motivation and Context
No js errors should be seen in the dev console. Try to check the length of val(), once we verify if the id exist in the DOM.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: