This is an automated email from the ASF dual-hosted git repository.
nmalin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 7792565 Fixed: Improve js function
OfbizUtil.ajaxSubmitFormUpdateAreas, some errors don't appear (OFBIZ-12268)
7792565 is described below
commit 7792565fcfadf5328e17ee88a586072462811ff2
Author: Nicolas Malin <[email protected]>
AuthorDate: Mon Jul 12 17:20:44 2021 +0200
Fixed: Improve js function OfbizUtil.ajaxSubmitFormUpdateAreas, some errors
don't appear (OFBIZ-12268)
After the refactoring realized on issue OFBIZ-12268, a typo has been
introduce when we scanned the presence of error during an ajax call.
The typo raised that ignore the case of an error is present as list.
The same typo is also present for event message list.
Thanks to Xin Wang to alert on this problem through issue OFBIZ-12272
---
themes/common-theme/webapp/common/js/util/OfbizUtil.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/themes/common-theme/webapp/common/js/util/OfbizUtil.js
b/themes/common-theme/webapp/common/js/util/OfbizUtil.js
index b1dcb8b..847cd6f 100644
--- a/themes/common-theme/webapp/common/js/util/OfbizUtil.js
+++ b/themes/common-theme/webapp/common/js/util/OfbizUtil.js
@@ -720,7 +720,7 @@ function submitFormInBackground(form, areaId, submitUrl) {
}
function containsErrorMessages(data) {
- return data.ERROR_MESSAGE_LIST_ != undefined || data._ERROR_MESSAGE_ !=
undefined
+ return data._ERROR_MESSAGE_LIST_ !== undefined || data._ERROR_MESSAGE_ !==
undefined
}
function displayErrorMessages(data) {
if (!jQuery('#content-messages').length) {
@@ -730,9 +730,9 @@ function displayErrorMessages(data) {
}
}
jQuery('#content-messages').addClass('errorMessage');
- if (data._ERROR_MESSAGE_LIST_ != undefined && data._ERROR_MESSAGE_ !=
undefined) {
+ if (data._ERROR_MESSAGE_LIST_ !== undefined && data._ERROR_MESSAGE_ !==
undefined) {
jQuery('#content-messages' ).html(data._ERROR_MESSAGE_LIST_ + " " +
data._ERROR_MESSAGE_);
- } else if (data._ERROR_MESSAGE_LIST_ != undefined) {
+ } else if (data._ERROR_MESSAGE_LIST_ !== undefined) {
jQuery('#content-messages' ).html(data._ERROR_MESSAGE_LIST_);
} else {
jQuery('#content-messages' ).html(data._ERROR_MESSAGE_);
@@ -741,7 +741,7 @@ function displayErrorMessages(data) {
}
function containsEventMessage(data) {
- return data.EVENT_MESSAGE_LIST_ != undefined || data._EVENT_MESSAGE_ !=
undefined
+ return data._EVENT_MESSAGE_LIST_ !== undefined || data._EVENT_MESSAGE_ !==
undefined
}
function displayEventMessage(data) {
if (!jQuery('#content-messages').length) {
@@ -751,7 +751,7 @@ function displayEventMessage(data) {
}
}
jQuery('#content-messages').addClass('eventMessage');
- if (data._EVENT_MESSAGE_LIST_ != undefined && data._EVENT_MESSAGE_ !=
undefined) {
+ if (data._EVENT_MESSAGE_LIST_ !== undefined && data._EVENT_MESSAGE_ !==
undefined) {
jQuery('#content-messages' ).html(data._EVENT_MESSAGE_LIST_ + " " +
data._EVENT_MESSAGE_);
} else if (data._EVENT_MESSAGE_LIST_ != undefined) {
jQuery('#content-messages' ).html(data._EVENT_MESSAGE_LIST_);