Skip to content

Core: fix remote validation when input is the same as in aborted request #2481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bidord
Copy link
Contributor

@bidord bidord commented Feb 20, 2024

Fixes #2479

Description

There is a bug in remote validation: if the Ajax request for a remote validation rule fails, an incorrect result will be stored in $element.data('previousValue'). Then, if the same input is validated again, the previous incorrect result will be re-used and no Ajax request will be sent.

In particular, this bug will occur when a request is aborted. Which happens more often (as it should) since #2435 was merged. (although the bug could already occur before #2435 in case of a server error).

I also had to fix the "remote, data previous querystring" test. It turns out the mocked request for this test was wrong. Which didn't matter before this PR: the failed remote validation was incorrectly considered as a validation result.

@bidord bidord force-pushed the fix-2479-remote-validation-fails branch from d5c04b6 to 94f4826 Compare February 21, 2024 08:20
@bytestream bytestream merged commit 569e622 into jquery-validation:master Apr 21, 2024
@bidord bidord deleted the fix-2479-remote-validation-fails branch September 23, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remote validation not working in last release
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy