mirror of
https://github.com/humhub/humhub.git
synced 2025-03-14 12:09:44 +01:00
Merge pull request #4235 from humhub/fix/dataTypeErrorOnAjaxError
Fix: Misleading error message 'Unable to determine dataType from resp…
This commit is contained in:
commit
0ed0c2a29e
@ -30,4 +30,5 @@ HumHub Change Log
|
||||
- Fix #4227: Removed redundant code from `humhub.ui.widget.js`
|
||||
- Fix #4232: Metadata request creates guest session if CSP nonce header is enabled
|
||||
- Enh #4234: Enhanced custom test environment configuration in `@protected/humhub/tests/config/env/env.php` file
|
||||
- Fix #4233: `humhub\modules\web\security\helpers\Security:setNonce()` does not remove nonce session value if nonce is null
|
||||
- Fix #4233: `humhub\modules\web\security\helpers\Security:setNonce()` does not remove nonce session value if nonce is null
|
||||
- Fix #4235: Misleading error message 'Unable to determine dataType from response' logged on ajax error
|
||||
|
@ -25,10 +25,11 @@ humhub.module('client', function (module, require, $) {
|
||||
dataType = 'json';
|
||||
} else if (responseType && responseType.indexOf('html') > -1) {
|
||||
dataType = 'html';
|
||||
} else if(!this.isAbort()){
|
||||
console.error('unable to determine dataType from response, this may cause problems.');
|
||||
} else if(!this.isAbort() && !this.isError()){
|
||||
console.error('Unable to determine dataType from response, this may cause problems.');
|
||||
}
|
||||
}
|
||||
|
||||
this.dataType = dataType;
|
||||
|
||||
// If we expect json and received json we merge the json result with our response object.
|
||||
@ -40,7 +41,11 @@ humhub.module('client', function (module, require, $) {
|
||||
};
|
||||
|
||||
Response.prototype.isAbort = function () {
|
||||
return this.textStatus == "abort";
|
||||
return this.textStatus === "abort";
|
||||
};
|
||||
|
||||
Response.prototype.isError = function () {
|
||||
return this.textStatus === "error";
|
||||
};
|
||||
|
||||
Response.prototype.header = function (key) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user