Skip to content
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

Fix #13920: Fixed erroneous validation for specific cases #19909

Merged
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.49 under development
------------------------

- Bug #13920: Fixed erroneous validation for specific cases (tim-fischer-maschinensucher)
- Bug #19899: Fixed `GridView` in some cases calling `Model::generateAttributeLabel()` to generate label values that are never used (PowerGamer1)
- Bug #9899: Fix caching a MSSQL query with BLOB data type (terabytesoftw)
- Bug #16208: Fix `yii\log\FileTarget` to not export empty messages (terabytesoftw)
Expand Down
8 changes: 8 additions & 0 deletions framework/assets/yii.activeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,11 @@
data: $form.serialize() + extData,
dataType: data.settings.ajaxDataType,
complete: function (jqXHR, textStatus) {
currentAjaxRequest = null;
$form.trigger(events.ajaxComplete, [jqXHR, textStatus]);
},
beforeSend: function (jqXHR, settings) {
currentAjaxRequest = jqXHR;
$form.trigger(events.ajaxBeforeSend, [jqXHR, settings]);
},
success: function (msgs) {
Expand Down Expand Up @@ -563,6 +565,9 @@
return;
}

if (currentAjaxRequest !== null) {
currentAjaxRequest.abort();
}
if (data.settings.timer !== undefined) {
clearTimeout(data.settings.timer);
}
Expand Down Expand Up @@ -929,4 +934,7 @@
$form.find(attribute.input).attr('aria-invalid', hasError ? 'true' : 'false');
}
}

var currentAjaxRequest = null;

})(window.jQuery);
Loading